当前位置: 首页>>代码示例>>C#>>正文


C# Autodesk.GetTypeId方法代码示例

本文整理汇总了C#中Autodesk.GetTypeId方法的典型用法代码示例。如果您正苦于以下问题:C# Autodesk.GetTypeId方法的具体用法?C# Autodesk.GetTypeId怎么用?C# Autodesk.GetTypeId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Autodesk的用法示例。


在下文中一共展示了Autodesk.GetTypeId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendSolid

        private void SendSolid(Autodesk.Revit.DB.Solid geomSolid, Autodesk.Revit.DB.Element elem)
        {
            Autodesk.Revit.DB.Material m = null;
             bool sameMaterial=true;
             int triangles=0;
             bool twoSided=false;

             Autodesk.Revit.DB.FaceArray faces = geomSolid.Faces;
             if (faces.Size == 0)
             {
            return;
             }

             Autodesk.Revit.DB.WallType wallType = elem.Document.GetElement(elem.GetTypeId()) as Autodesk.Revit.DB.WallType; // get element type
             if (wallType != null)
             {
             if (wallType.Kind == Autodesk.Revit.DB.WallKind.Curtain)
            {
               //return; // don't display curtain walls, these are probably fassades with bars and Glazing
            }
             }
             Autodesk.Revit.DB.ElementId materialID;
             materialID = faces.get_Item(0).MaterialElementId;
             foreach (Autodesk.Revit.DB.Face face in faces)
             {
            if (m == null)
            {
                materialID = face.MaterialElementId;
                Autodesk.Revit.DB.Material materialElement = elem.Document.GetElement(face.MaterialElementId) as Autodesk.Revit.DB.Material;

                /* Autodesk.Revit.DB.ElementId appearanceID = materialElement.AppearanceAssetId;
                 Autodesk.Revit.DB.AppearanceAssetElement ae = elem.Document.GetElement(appearanceID) as Autodesk.Revit.DB.AppearanceAssetElement;
                 Autodesk.Revit.Utility.Asset asset = ae.GetRenderingAsset();
                 Autodesk.Revit.DB.ParameterSet ps = ae.Parameters;
                 for (int i = 0; i < asset.Size; i++)
                 {
                     Autodesk.Revit.Utility.AssetProperty ap = asset[i];
                     string pn = ap.Name;
                     string val = ap.ToString();

                     System.Collections.Generic.IList<string> props = ap.GetConnectedPropertiesNames();
                     foreach (string p in props)
                     {
                         string pName = p;
                     }
                 }
                 foreach (Autodesk.Revit.DB.Parameter p in ae.Parameters)
                 {
                     string pName = p.AsString();
                     string val = p.AsValueString();
                 }
                System.Collections.Generic.IList<Autodesk.Revit.Utility.AssetProperty> props2 = asset.GetAllConnectedProperties();*/
                m = materialElement;
               twoSided = face.IsTwoSided;
            }
            Autodesk.Revit.DB.Mesh geomMesh = face.Triangulate();
            if (geomMesh != null)
            {
               triangles += geomMesh.NumTriangles;
               if (materialID != face.MaterialElementId)
               {
                  sameMaterial = false;
                  break;
               }
            }
             }
             if (triangles == 0)
            return;
             if (sameMaterial)
             {
            MessageBuffer mb = new MessageBuffer();
            mb.add(elem.Id.IntegerValue);
            mb.add(elem.Name + "_combined");
            mb.add((int)ObjectTypes.Mesh);
            mb.add(twoSided);
            mb.add(triangles);

            int i = 0;

            foreach (Autodesk.Revit.DB.Face face in geomSolid.Faces)
            {
               Autodesk.Revit.DB.Mesh geomMesh = face.Triangulate();
               if (geomMesh != null)
               {
                  for (i = 0; i < geomMesh.NumTriangles; i++)
                  {
                     Autodesk.Revit.DB.MeshTriangle triangle = default(Autodesk.Revit.DB.MeshTriangle);
                     triangle = geomMesh.get_Triangle(i);
                     mb.add((float)triangle.get_Vertex(0).X);
                     mb.add((float)triangle.get_Vertex(0).Y);
                     mb.add((float)triangle.get_Vertex(0).Z);
                     mb.add((float)triangle.get_Vertex(1).X);
                     mb.add((float)triangle.get_Vertex(1).Y);
                     mb.add((float)triangle.get_Vertex(1).Z);
                     mb.add((float)triangle.get_Vertex(2).X);
                     mb.add((float)triangle.get_Vertex(2).Y);
                     mb.add((float)triangle.get_Vertex(2).Z);
                  }
               }
            }
//.........这里部分代码省略.........
开发者ID:dwickeroth,项目名称:covise,代码行数:101,代码来源:COVER.cs

示例2: isCalculationOn

        private bool isCalculationOn(Document doc, Autodesk.Revit.DB.MEPSystem mepSys)
        {
            if (mepSys == null)
            return false;
             MEPSystemType sysType = doc.GetElement(mepSys.GetTypeId()) as MEPSystemType;
             if (sysType == null)
            return false;

             return sysType.CalculationLevel == Autodesk.Revit.DB.Mechanical.SystemCalculationLevel.All;
        }
开发者ID:jeremytammik,项目名称:UserMepCalculation,代码行数:10,代码来源:ReportSystemSelectorDlg.cs


注:本文中的Autodesk.GetTypeId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。