zoukankan      html  css  js  c++  java
  • AVEVA CSG 几何图形输出接口

    一、 概述

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

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

  • 相关阅读:
    Eclipse Alt + / 快捷键失效
    oracle nvl()函数
    搭建spring boot项目
    Maximum call stack size exceeded
    vue混入函数问题
    ASP.NET Core 2.0中的Azure Blob存储
    如何在ASP.NET Core 2.0中使用Razor页面
    将参数传递给ASP.NET Core 2.0中的中间件
    使用.net core在Ubuntu构建一个TCP服务器
    如何在ASP.NET Core Web API测试中使用Postman
  • 原文地址:https://www.cnblogs.com/jevon1982/p/9532354.html
Copyright © 2011-2022 走看看