本文整理汇总了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);
}
}
}
//.........这里部分代码省略.........
示例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;
}