Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

collecting foundation slab

2 REPLIES 2
Reply
Message 1 of 3
Padmini.Ramakrishnan
784 Views, 2 Replies

collecting foundation slab

Hi all,

 

I trying to collect all the structural foundation slab by filtered element collector, How to give Is foundation slab = true in below code.

 

foreach (Element myfil in new FilteredElementCollector(doc, doc.ActiveView.Id).OfClass(typeof(FloorType))
.OfCategory(BuiltInCategory.OST_StructuralFoundation)

 

scren shot is attached for more clarity.

 

Thanks In advance.

 

Regards

Padhu

2 REPLIES 2
Message 2 of 3

I would suggest you go with LINQ

 

FilteredElementCollector coll = new FilteredElementCollector(doc, doc.ActiveView.Id).OfClass(typeof(FloorType)).OfCategory(BuiltInCategory.OST_StructuralFoundation);
var collFoundationSlab = from FloorType ft in coll where ft.IsFoundationSlab == true select ft;
foreach (Element myfil in collFoundationSlab)
{

}
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 3 of 3

Padhu,

 

The Class for Foundation slabs is CeilingandFloor and not FloorType. I had a similar issue trying to collect the foundation slabs and lead me to that. Hope this helps!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community