當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。