1. 程式人生 > >AVEVA CSG 幾何圖形輸出接口

AVEVA CSG 幾何圖形輸出接口

ren eve geo 數據 數字化 ons man .com try

一、 概述

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 幾何圖形輸出接口