当前位置: 首页>>代码示例>>C#>>正文


C# FilteredElementCollector.ForwardIterator方法代码示例

本文整理汇总了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 );
        }
开发者ID:halad,项目名称:RevitLookup,代码行数:38,代码来源:TestElements.cs

示例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" );
        }
开发者ID:halad,项目名称:RevitLookup,代码行数:43,代码来源:TestElements.cs


注:本文中的FilteredElementCollector.ForwardIterator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。