本文整理汇总了C#中FilteredElementCollector.GetEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C# FilteredElementCollector.GetEnumerator方法的具体用法?C# FilteredElementCollector.GetEnumerator怎么用?C# FilteredElementCollector.GetEnumerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilteredElementCollector
的用法示例。
在下文中一共展示了FilteredElementCollector.GetEnumerator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FoundationSlabHardWired
FoundationSlabHardWired()
{
CurveArray curveArray = m_revitApp.Application.Create.NewCurveArray();
XYZ location1 = GeomUtils.kOrigin;
XYZ location2 = new XYZ( 0.0, 20.0, 0.0 );
XYZ location3 = new XYZ( 20.0, 20.0, 0.0 );
XYZ location4 = new XYZ( 20.0, 0.0, 0.0 );
curveArray.Append( Line.CreateBound( location1, location2 ) );
curveArray.Append( Line.CreateBound( location2, location3 ) );
curveArray.Append( Line.CreateBound( location3, location4 ) );
curveArray.Append( Line.CreateBound( location4, location1 ) );
List<FloorType> floorTypeSet = new FilteredElementCollector(m_revitApp.ActiveUIDocument.Document).OfClass(typeof(FloorType)).Cast<FloorType>() as List<FloorType>;
IEnumerator<FloorType> floorTypeSetIter = floorTypeSet.GetEnumerator();
FloorType floorType = null;
while( floorTypeSetIter.MoveNext() )
{
FloorType floorTypeTemp = floorTypeSetIter.Current as FloorType;
if( floorTypeTemp.Name == "6\" Foundation Slab" )
{
floorType = floorTypeTemp;
break;
}
}
Level level = m_revitApp.ActiveUIDocument.Document.ActiveView.GenLevel;
XYZ normal = GeomUtils.kZAxis;
/// create a slab
m_revitApp.ActiveUIDocument.Document.Create.NewFoundationSlab( curveArray, floorType, level, false, normal );
/// floor slab is below all levels and is not visible in floor plan view!
if( m_revitApp.ActiveUIDocument.Document.ActiveView.ViewType != ViewType.ThreeD
&& m_revitApp.ActiveUIDocument.Document.ActiveView.ViewType != ViewType.Elevation )
MessageBox.Show( "Foundation slab created. Go to 3D or Elevation views to view" );
}
示例2: AnnoSymbol
AnnoSymbol()
{
Revit.Document doc = m_revitApp.ActiveUIDocument.Document;
FamilyItemFactory famFact = doc.FamilyCreate;
List<AnnotationSymbolType> annoSymTypeSet = new FilteredElementCollector(doc).OfClass(typeof(AnnotationSymbol)).Cast<AnnotationSymbol>() as List<AnnotationSymbolType>;
// TBD: why is the size only 2
Int32 size = annoSymTypeSet.Count;
IEnumerator<AnnotationSymbolType> annoSymTypeSetIter = annoSymTypeSet.GetEnumerator();
AnnotationSymbolType annoSymType = null;
while( annoSymTypeSetIter.MoveNext() )
{
AnnotationSymbolType tempAnnoSymType = annoSymTypeSetIter.Current as AnnotationSymbolType;
if( null != tempAnnoSymType )
{
if( tempAnnoSymType.Name == "North Arrow 2" )
{
annoSymType = tempAnnoSymType;
}
}
}
if( annoSymType == null )
return;
XYZ location = GeomUtils.kOrigin;
Autodesk.Revit.DB.View view = m_revitApp.ActiveUIDocument.Document.ActiveView;
doc.Create.NewFamilyInstance( location, annoSymType, view );
}