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: 

hide selected elements

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
sabatierae
442 Views, 2 Replies

hide selected elements

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!!

2 REPLIES 2
Message 2 of 3
Scott_Wilson
in reply to: sabatierae

For revit 2015 you can simply do:

 

List<ElementId> selectedIds = uiApp.ActiveUIDocument.Selection.GetElementIds().ToList();
uiApp.ActiveUIDocument.ActiveGraphicalView.HideElements(selectedIds);

 

 

Message 3 of 3
sabatierae
in reply to: Scott_Wilson

thank a lot!!

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