Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66860

Re: Select all physical items in model

$
0
0

When you  use a familyInstance filter , you only find User Created families, and not the system families.

 

try:

 

public static class Extensions

{

public static bool IsPhysicalElement(this Element e)

{

if (e.Category == null) return false;

if (e.ViewSpecific) return false;

// exclude specific unwanted categories

if (((BuiltInCategory)e.Category.Id.IntegerValue) == BuiltInCategory.OST_HVAC_Zones) return false;

//

return e.Category.CategoryType == CategoryType.Model && e.Category.CanAddSubcategory;

}

}

 

 

List<Element> AllElem = new FilteredElementCollector(document)

.WhereElementIsNotElementType()

.Where(e =>e.IsPhysicalElement() )

.ToList<Element>();

 

 


Viewing all articles
Browse latest Browse all 66860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>