Pick elements of linked model

Pick elements of linked model

rbvic_7
Observer Observer
301 Views
2 Replies
Message 1 of 3

Pick elements of linked model

rbvic_7
Observer
Observer
 

Good day people. I wanted to take advantage of the space to ask you a question regarding PickObjects on linked elements. Is it possible to access the parameters of a linked element that has previously been selected with Pick Objects? Because the type of object that it brings me is the reference of the total link, not of the clicked element. Thank you very much in advance if you can respond. 

0 Likes
302 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

This sounds pretty familiar... Have you checked the preceding similar discussions?

  

https://forums.autodesk.com/t5/forums/searchpage/tab/message?advanced=false&allow_punctuation=false&...

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

GaryOrrMBI
Collaborator
Collaborator
If you are in R2023 or 2024 and you are referring to the references returned from Selection.GetReferences to get a previously selected element or group of elements from a Revit Link, then the Reference returned will have an ElementId that is the RevitLinkInstance ElementId and it will have a LinkedElementId that is the ElementId of the object as it exists in the linked document.

With this new workflow you use hostDoc.GetElement(ElementId value) to get the RevitLinkInstance, from that you can use the .GetLinkDocument method to grab the link document, then linkDoc.GetElement(LinkedElementId value) and that will give you access to the Methods, Properties, and yes, Parameters, of the element in question.

Also take a look at this post for creating references to show or pass back out to the user (the only reference that I was able to find for these new methods):

https://forums.autodesk.com/t5/revit-api-forum/selection-of-linked-elements-does-not-look-correct/td...

-G
Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)
0 Likes