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: 

Filtered Element Collector

3 REPLIES 3
Reply
Message 1 of 4
W0044793
581 Views, 3 Replies

Filtered Element Collector

Hi

I have created a plugin that uses a filtered element collector to capture Electrical Equipment in a model. It works perfectly on a model that is based on our network however does not find the elements when a Bim 360 model is opened.

 

My code

 

UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Autodesk.Revit.ApplicationServices.Application app = uiapp.Application;
Document doc = uidoc.Document;

//Retrieve elements from database
FilteredElementCollector col1
= new FilteredElementCollector(doc)
.WhereElementIsNotElementType() .OfCategory(BuiltInCategory.OST_ElectricalEquipment);

 

Thanks for your help.

Michael

3 REPLIES 3
Message 2 of 4
jshial
in reply to: W0044793

Is there any chance that the electrical equipment are linked in the model living in BIM360?

Message 3 of 4
W0044793
in reply to: jshial

No there is and architectural model linked though...when I create a new electrical equipment element the collector can't find it either so seems the code can't connect to the data base somehow?

Message 4 of 4
Sean_Page
in reply to: W0044793

If you are trying to use the FEC on a linked model, you will need to get the LinkInstance to retrieve the Document of the link, then run the FEC on the link and not on the local doc.

 

FilteredElementCollector col1 = new FilteredElementCollector(linkDoc)
.WhereElementIsNotElementType().OfCategory(BuiltInCategory.OST_ElectricalEquipment);

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

Post to forums  

Forma Design Contest


Rail Community