AVEVA CSG 几何图形输出接口

本文介绍如何使用AVEVA12.1的CSG接口输出几何模型数据,通过示例代码展示了如何从PDMS中抽取三维模型至其他软件,特别适用于数字化移交时的模型输出开发。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、 概述

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格式文件。

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

 

转载于:https://www.cnblogs.com/jevon1982/p/9532354.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值