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
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?
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.