码迷,mamicode.com
首页 > 其他好文 > 详细

AVEVA CSG 几何图形输出接口

时间:2018-08-24 23:39:36      阅读:339      评论:0      收藏:0      [点我收藏+]

标签:cmd   length   出接口   init   三维   格式   evel   level   方式   

一、 概述

AVEVA 12.1支持CSG接口用于输出几何模型数据。

二、 示例代码

 1 DbElement ce = CurrentElement.Element;
 2 Aveva.Pdms.CSG.Implementation.CSGTreeBuilderImpl.Init();
 3 Aveva.Pdms.CSG.Implementation.CSGTreeBuilderOptionsImpl op = (Aveva.Pdms.CSG.Implementation.CSGTreeBuilderOptionsImpl)Aveva.Pdms.CSG.Implementation.CSGTreeBuilderImpl.Instance.CreateCSGTreeBuilderOptions();
 4 op.CenterLine = false;
 5 op.Holes = false;
 6 op.Level = 6;
 7 op.SolidOnly = true;
 8 op.Tube = true;
 9 CSGTree[] tree = Aveva.Pdms.CSG.Implementation.CSGTreeBuilderImpl.Instance.GetGeometry(ce, op);
10 for (int a = 0; a < tree.Length; a++)
11 {
12     for (int b = 0; b < tree[a].Items.Length; b++)
13     {
14         string Command;
15         Aveva.Pdms.Utilities.CommandLine.Command cmd;
16         switch (tree[a].Items[b].Type)
17         {
18             case CSGType.CSG_BOX:
19                 CSGBox box = tree[a].Items[b] as CSGBox;
20                 double x = box.XLength;
21                 double y = box.YLength;
22                 double z = box.ZLength;
23                 System.Console.WriteLine("CSGBox x:{0} y:{1} z:{2}", x, y, z);
24                 break;
25             case CSGType.CSG_CYLI:
26                 CSGCylinder cylinder = tree[a].Items[b] as CSGCylinder;
27                 double radius = cylinder.Radius;
28                 double height = cylinder.Height;
29                 System.Console.WriteLine("CSGCylinder radius:{0} height:{1}", radius, height);  
30                 break;
31                 .............................................. 
32                     .............................................. 
33                 ..............................................  
34             default:
35                 break;
36         }
37 
38     }
39 }

三、总结

通过CSG接口我们可以直接从PDMS中有选择性的抽取PDMS三维模型数据到其他软件。通过编程的方式操作更加灵活,而无需使用rvm格式文件。

特别适合需要做数字化移交时的模型输出开发。

 

AVEVA CSG 几何图形输出接口

标签:cmd   length   出接口   init   三维   格式   evel   level   方式   

原文地址:https://www.cnblogs.com/jevon1982/p/9532354.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!