Skip to content

Commit

Permalink
implemented GetAllModelElements
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Tammik committed Sep 14, 2015
1 parent fd988c2 commit 171a6f9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
19 changes: 19 additions & 0 deletions BuildingCoder/BuildingCoder/CmdCollectorPerformance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,25 @@ class CmdCollectorPerformance : IExternalCommand
{
Document _doc;

#region Get all model elements
/// <summary>
/// Return all model elements, cf.
/// http://forums.autodesk.com/t5/revit-api/traverse-all-model-elements-in-a-project-top-down-approach/m-p/5815247
/// </summary>
IEnumerable<Element> GetAllModelElements(
Document doc )
{
Options opt = new Options();

return new FilteredElementCollector( doc )
.WhereElementIsNotElementType()
.WhereElementIsViewIndependent()
.Where<Element>( e
=> null != e.Category
&& null != e.get_Geometry( opt ) );
}
#endregion // Get all model elements

#region Traverse all model elements top down Levels > Category > Family > Type > Instance
void TraverseInstances( Document doc )
{
Expand Down
5 changes: 3 additions & 2 deletions BuildingCoder/BuildingCoder/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
// 2015-09-04 2016.0.120.10 added original EditFilledRegion to show code improvements
// 2015-09-04 2016.0.120.11 in EditFilledRegion: foreach iter, using tx, single tx, XYZ static member
// 2015-09-04 2016.0.120.12 in EditFilledRegion: use MoveElements instead of MoveElement
// 2015-09-14 2016.0.120.13 implemented GetAllModelElements
//
[assembly: AssemblyVersion( "2016.0.120.12" )]
[assembly: AssemblyFileVersion( "2016.0.120.12" )]
[assembly: AssemblyVersion( "2016.0.120.13" )]
[assembly: AssemblyFileVersion( "2016.0.120.13" )]

0 comments on commit 171a6f9

Please sign in to comment.