PPT_LOGO_4b
Revit Programming Introduction <#>
Copyright © 2009 Autodesk Inc.
3D / モデル要素
•public static ElementSet GetAllModelElements( Application app )
•{
•  ElementSet elems = app.Create.NewElementSet();
•  Geo.Options opt = app.Create.NewGeometryOptions(); // this is ok
•  ElementIterator iter = app.ActiveDocument.Elements;
•  while( iter.MoveNext() )
•  {
•    Autodesk.Revit.Element elem = iter.Current as Autodesk.Revit.Element;
•    if( !( elem is Symbol || elem is FamilyBase ) )
•    {
•      if( null != elem.Category )
•      {
•        if( null != elem.get_Geometry( opt ) )
•        {
•          elems.Insert( elem );
•        }
•      }
•    }
•  }
•  return elems;
•}
要素コレクション
lab2-2-1 lab2-2-2
さらに、3Dモデルの場合はジオメトリという情報を保持しています。
この要素の有無で判別を行います。