本文整理汇总了C#中Autodesk.GetEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C# Autodesk.GetEnumerator方法的具体用法?C# Autodesk.GetEnumerator怎么用?C# Autodesk.GetEnumerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autodesk
的用法示例。
在下文中一共展示了Autodesk.GetEnumerator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsCommandAvailable
public bool IsCommandAvailable(UIApplication applicationData,
Autodesk.Revit.DB.CategorySet selectedCategories)
{
System.Collections.IEnumerator iterCategory = selectedCategories.GetEnumerator();
iterCategory.Reset();
while (iterCategory.MoveNext())
{
Autodesk.Revit.DB.Category category = (Autodesk.Revit.DB.Category)(iterCategory.Current);
if (category.Name == "Walls")
{
return false;
}
}
return true;
}
示例2: SendElement
/// <summary>
/// Draw geometry of element.
/// </summary>
/// <param name="elementGeom"></param>
/// <remarks></remarks>
private void SendElement(Autodesk.Revit.DB.GeometryElement elementGeom, Autodesk.Revit.DB.Element elem)
{
if (elementGeom == null)
{
return;
}
try
{
if (elem.IsHidden(View3D))
{
return;
}
if (!elem.Category.get_Visible(View3D as Autodesk.Revit.DB.View))
{
return;
}
}
catch
{
}
int num = 0;
IEnumerator<Autodesk.Revit.DB.GeometryObject> Objects = elementGeom.GetEnumerator();
while (Objects.MoveNext())
{
Autodesk.Revit.DB.GeometryObject geomObject = Objects.Current;
if (geomObject.Visibility == Autodesk.Revit.DB.Visibility.Visible)
{
if ((geomObject is Autodesk.Revit.DB.Curve))
{
//mb.add((int)ObjectTypes.Curve);
//SendCurve(geomObject);
}
else if ((elem is Autodesk.Revit.DB.SpatialElement))
{
// don't show room volumes
}
else if ((geomObject is Autodesk.Revit.DB.GeometryInstance))
{
/*if (elem.Category.Name != "{3}")
{
if (!elem.Category.get_Visible(View3D as Autodesk.Revit.DB.View))
{
return;
}
}*/
SendInstance(geomObject as Autodesk.Revit.DB.GeometryInstance, elem);
}
else if ((geomObject is Autodesk.Revit.DB.Mesh))
{
MessageBuffer mb = new MessageBuffer();
mb.add(elem.Id.IntegerValue);
mb.add(elem.Name + "_m_" + num.ToString());
mb.add((int)ObjectTypes.Mesh);
Autodesk.Revit.DB.Mesh meshObj = geomObject as Autodesk.Revit.DB.Mesh;
SendMesh(meshObj, ref mb, true);// TODO get information on whether a mesh is twosided or not
Autodesk.Revit.DB.ElementId materialID;
materialID = meshObj.MaterialElementId;
Autodesk.Revit.DB.Material materialElement = elem.Document.GetElement(materialID) as Autodesk.Revit.DB.Material;
if (materialElement != null)
{
mb.add(materialElement.Color);
mb.add((byte)(((100 - (materialElement.Transparency)) / 100.0) * 255));
mb.add(materialID.IntegerValue); // material ID
}
else
{
mb.add((byte)250); // color
mb.add((byte)250);
mb.add((byte)250);
mb.add((byte)255);
mb.add(-1); // material ID
}
sendMessage(mb.buf, MessageTypes.NewObject);
if (num == 0)
sendParameters(elem);
}
else if ((geomObject is Autodesk.Revit.DB.Solid))
{
MessageBuffer mb = new MessageBuffer();
mb.add(elem.Id.IntegerValue);
mb.add(elem.Name + "_s_" + num.ToString());
sendMessage(mb.buf, MessageTypes.NewGroup);
SendSolid((Autodesk.Revit.DB.Solid)geomObject, elem);
mb = new MessageBuffer();
sendMessage(mb.buf, MessageTypes.EndGroup);
if(num == 0)
sendParameters(elem);
}
num++;
}
}
}