Community
Hi,
I try to create a program that hide selected element.
I wanted to do something like that
Selection sel = uiApp.ActiveUIDocument.Selection;
// How Can I get the elementsId of my selection? // This "list" is called elementIdCollector ICollection<ElementId> collectionSelectedElement = null; foreach (ElementId eId in elementIdCOllector) { collectionSelectedElement.Add(eId) } doc.ActiveView.HideElements(collectionSelectedElement);
Can someone help me please?
Thank!!
Solved! Go to Solution.
Solved by Scott_Wilson. Go to Solution.
For revit 2015 you can simply do:
List<ElementId> selectedIds = uiApp.ActiveUIDocument.Selection.GetElementIds().ToList(); uiApp.ActiveUIDocument.ActiveGraphicalView.HideElements(selectedIds);