Retrieve all types in type selector

Retrieve all types in type selector

markjvlampad
Advocate Advocate
665 Views
1 Reply
Message 1 of 2

Retrieve all types in type selector

markjvlampad
Advocate
Advocate

 

 

this code is working in selecting all framing category used in project.

List<ElementType> beams = new FilteredElementCollector(doc, doc.ActiveView.Id).OfClass(typeof(ElementType)).OfCategory(BuiltInCategory.OST_StructuralFraming).Cast<ElementType>().ToList();

 

however what I want to get are all framing type in type selector.

 

thanks.

 

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

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @markjvlampad,

See whether the below code helps

FilteredElementCollector collector = new FilteredElementCollector(doc).OfClass(typeof(ElementType)).OfCategory(BuiltInCategory.OST_StructuralFraming).WhereElementIsElementType();
                IList<ElementType> element_types=collector.Cast<ElementType>().ToList() as IList<ElementType>;

Naveen Kumar T
Developer Technical Services
Autodesk Developer Network