copy Tags from linked model

sabra.tarek
Participant
Participant

copy Tags from linked model

sabra.tarek
Participant
Participant

hello everybody , 

Does anyone know please how to copy Tags from a linked model into the host revit file ? 

 

thank you for any help

0 Likes
Reply
261 Views
8 Replies
Replies (8)

TripleM-Dev.net
Advisor
Advisor

I would simply recreate them, you have the linked model element Id, and the tag (relative) position

From doc: can create a Tag to a linked element https://www.revitapidocs.com/2023/b8e8eec2-8e3b-08f2-a9a5-89f24465c8b9.htm 

sabra.tarek
Participant
Participant

Thank you alot for your suggestion ,the situation is that inside that link the tag is putten on another linked model, is there a way to get the element id of those link inside link elements ? or anyway to recreate them

0 Likes

Sleepingfish_Kuo
Contributor
Contributor

I'd like to know how to select an element in link model by API or by Enter the ID somewhere in UI, just like click many times of Tab and pick by mouse.

0 Likes

TripleM-Dev.net
Advisor
Advisor

Hi @sabra.tarek ,

 

You can iterate all tags in a linked model and get it's TaggedElementId.

I don't know if it's possible to get the LinkedElementId of a Tagged nested link, as that link doesn't exist in the host document, could be it won't report the linkedElementid?

 

You would almost have the link itself openend as a model, and then re-create the tags, from reading from the other opened document (with the link that's tagged), in the same Revit session of course.

But you should then be tagging that nested link...or what does need to be tagged.

 

So you have this structure.

HostModel A

-> LinkeModel B (with tags to C)

   -> NestedModel C (linked as overlay or attachement in B?)

 

Is NestedModel C also directly linked into A?

Ps. For what kind (category) do the tags need to be copied over?

 

0 Likes

TripleM-Dev.net
Advisor
Advisor

Hi @Sleepingfish_Kuo ,

 

Use PickObjects methods and use "ObjectType.LinkedElement" as argument.

For ID, would only work if you also have the RevitLinkInstance Id.

Sleepingfish_Kuo
Contributor
Contributor

Oh, thank you.
But what I want is to let the element be selected in UI, just like 

 

Selection.SetElementIds(elementID);

 

in API.

 

I can get the link IDs from Interference check, but no where to use it except opening that link in another revit.

 

0 Likes

jackmrdoctor
Contributor
Contributor

What type of type you want to copy, because an independent tag needs host element, your approach mat not work.
revit will delete the copied tag with you dont get it a host. I have try it before for lightingfixture tag

0 Likes

TripleM-Dev.net
Advisor
Advisor

Well for this the Revit Version comes into play.

In Revit 2024 I think the selection of elements in links is possible, search the web or this forum or the https://www.revitapidocs.com/