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: 

Selecting an element from elementid

3 REPLIES 3
Reply
Message 1 of 4
Jaki
507 Views, 3 Replies

Selecting an element from elementid

We can able to select an element by giving element id by using elementsid property dialog box from tools menu. Similarly, I need to show an element by using element id by using API. Do any one know what function takes element id to show an element by using elementid.
3 REPLIES 3
Message 2 of 4
Janet Yang
in reply to: Jaki

for example, the element id value is 132059, you can use following code segment to show the element.

Document^ doc = commandData->Application->ActiveDocument;
ElementId id;
id.Value = 132059;
Autodesk::Revit::Element^ selElement = doc->Element[id];

Selection^ sel = doc->Selection;
sel->Elements->Add(selElement );
Message 3 of 4
Anonymous
in reply to: Jaki

Hi,
it's works fine just if element is in current view,
if element is not in current view it doesn't work.
Ho can I change active view from API ?
Thank's in advance
Max
Message 4 of 4
Janet Yang
in reply to: Jaki

Hi,
if element is not in current view it still works. Then the element is selected but the Revit will not change the active view to show the selected element.
And now there is a lack of relevant function to change active view through API. I think we should put forward a request to Autodesk.

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