Retrieve only the loaded floor types in a project

Retrieve only the loaded floor types in a project

ridaabderrahmane
Enthusiast Enthusiast
1,032 Views
2 Replies
Message 1 of 3

Retrieve only the loaded floor types in a project

ridaabderrahmane
Enthusiast
Enthusiast

Hi All,

i'm trying to retrieve all the floor types loaded in a project. m y code looks like this:

 

List<FloorType> FloorTypes = new FilteredElementCollector(doc).WhereElementIsElementType().OfClass(typeof(FloorType)).Cast<FloorType>().ToList();

 

but the list given contains a FloorType that does non exist when i go trough the floor types when editing a floor for example. So i fail creatinf a floor with this type.

is there a way to retrieve only the floortypes loaded in the project? 

 

Thanks in advance,

0 Likes
Accepted solutions (1)
1,033 Views
2 Replies
Replies (2)
Message 2 of 3

so-chong
Advocate
Advocate
Accepted solution

Hi,

 

Retrieving all floor types of class FloorType also includes Foundation Slab of category Structural Foundations.
Maybe that's what you experience that some Floortype(s) does not exist in your list when you go through the floor types.
The FloorType class has a IsFoundationSlab property which you can use to check whether the FloorType is type of Foundation Slab and separate from your list.

 

Hope this is useful for you.

Message 3 of 3

ridaabderrahmane
Enthusiast
Enthusiast
  • thank you very much.
0 Likes