Accessing RoofSoffit via RevitAPI

Accessing RoofSoffit via RevitAPI

h.mandadapu
Community Visitor Community Visitor
215 Views
1 Reply
Message 1 of 2

Accessing RoofSoffit via RevitAPI

h.mandadapu
Community Visitor
Community Visitor

I faced a issue accessing roofsoffit using filteredelementcollector of roofSoffit category.

'foreach (Element e in new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_RoofSoffit))'

The revit api is not allowing to show the elements which are in RoofSoffit category even though they exist in revit model file.

Could anyone help me in understanding and figuring out this issue?

 

 

0 Likes
216 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

Yes. Read the documentation, please. In the notes on OfClass, it says:

 

https://www.revitapidocs.com/2022/b0a5f22c-6951-c3af-cd29-1f28f574035d.htm

 

Only elements whose class is an exact match to the input class, or elements whose type is derived from the input class will pass the collector.

 

There is a small subset of Element subclasses in the API that are not supported by this filter. These classes exist in the API, but not in Revit's native object model, which means that this filter doesn't support them. In order to use a class filter to find elements of these types, it is necessary to use a higher level class and then process the results further to find elements matching only the subclass. For a list of subclasses affected by this restriction, consult the documentation for ElementClassFilter.

 

The Building Coder ran into this issue numerous times and first discusses it here:

 

https://thebuildingcoder.typepad.com/blog/2010/08/filtering-for-a-nonnative-class.html

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes