Unable to isolate AssemblyInstance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Macro function to Isolate selected assembly instances. After the isolation view is empty.
public void IsolateAssembly()
{
UIDocument uiDoc = ActiveUIDocument;
Document doc = uiDoc.Document;
List<ElementId> elements = new List<ElementId>();
foreach (var id in uiDoc.Selection.GetElementIds())
{
Element tempElem = doc.GetElement(id);
if(tempElem is AssemblyInstance)
{
elements.Add(tempElem.Id);
}
}
using (Transaction tx = new Transaction(doc))
{
tx.Start("Isolate Assembly");
doc.ActiveView.IsolateElementsTemporary(elements);
uiDoc.RefreshActiveView();
tx.Commit();
}
}