Get All Element Types

Get All Element Types

jmyr
Enthusiast Enthusiast
2,227 Views
1 Reply
Message 1 of 2

Get All Element Types

jmyr
Enthusiast
Enthusiast

Hi All im trying to get all element types like in dynamo but using c# but no success. Please see below.

 
 
 

Untitled.png

i tried below code but i get different result

 

 

            List<ElementType> elementTypes = new FilteredElementCollector(_doc)
                .OfClass(typeof(ElementType))
                .WhereElementIsElementType()
                .Select(x => (ElementType)x)
                .ToList();

 

Thanks 

0 Likes
Accepted solutions (1)
2,228 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk
Accepted solution

Probably the list you show in the image is using a different vocabulary than the Revit API.

 

Maybe what you really are after are categories, not element types?

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes