本文整理汇总了C#中FilteredElementCollector.ForwardIterator方法的典型用法代码示例。如果您正苦于以下问题:C# FilteredElementCollector.ForwardIterator方法的具体用法?C# FilteredElementCollector.ForwardIterator怎么用?C# FilteredElementCollector.ForwardIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilteredElementCollector
的用法示例。
在下文中一共展示了FilteredElementCollector.ForwardIterator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AnnoSymbol
/// <summary>
/// Creates a new annotation symbol
/// </summary>
public void AnnoSymbol()
{
Revit.Document doc = m_revitApp.ActiveUIDocument.Document;
FamilyItemFactory famFact = doc.FamilyCreate;
AnnotationSymbolTypeSet annoSymTypeSet = new FilteredElementCollector( doc ).OfClass( typeof( AnnotationSymbol ) ).Cast<AnnotationSymbol>() as AnnotationSymbolTypeSet;
// TBD: why is the size only 2
Int32 size = annoSymTypeSet.Size;
AnnotationSymbolTypeSetIterator annoSymTypeSetIter = annoSymTypeSet.ForwardIterator();
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 );
}
示例2: FoundationSlabHardWired
/// <summary>
/// Creates hardwired foundation slabs
/// </summary>
public void 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 ) );
FloorTypeSet floorTypeSet = new FilteredElementCollector( m_revitApp.ActiveUIDocument.Document ).OfClass( typeof( FloorType ) ).Cast<FloorType>() as FloorTypeSet;
FloorTypeSetIterator floorTypeSetIter = floorTypeSet.ForwardIterator();
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" );
}