Independent Tag position

alexpaduroiu
Participant

Independent Tag position

alexpaduroiu
Participant
Participant

Hello!

 

I have a problem regarding tags position and I hope someone can help me.

 

Whenever I successfully create an independent tag for a reinforcement bar, the tag position follows the same transformation I apply to the bar. Lets say for example, if i move my rebar position 3 centimeters in the right direction, the tag position will move the same 3 centimeters in the right direction.

 

Please let me know if there is a way to maintain the initial position of the tag, no matter the transformation applied to its host element.

The method I used to create a tag is: 

IndependentTag crTag = IndependentTag.Create(Document, Document.ActiveView.Id, new Reference(rebar), false, TagMode.TM_ADDBY_CATEGORY, tagOrientation, position);

 

Thanks.

0 Likes
Reply
Accepted solutions (1)
2,484 Views
3 Replies
Replies (3)

FlorisvdG
Advocate
Advocate
Accepted solution

I don't believe you can prevent the Tag from moving.

 

You can however simply move it back, directly after moving the element.
using:

Tag.Location.Move(XYZ translation);

 

Where Tag is the instance of the IndependentTag ofcourse.

XYZ here is a translation, so (0,0,0)  means no moving,  (10,0,0) means move it 10 units over the x-axis.

 

https://www.revitapidocs.com/2018.2/c64687d8-ab52-e36d-a095-2715e5660df6.htm

alexpaduroiu
Participant
Participant

Well that was a last resort solution. I thought that there can be another way around to hold the position without using the element translation. 

Thank you for your answer! 😄

0 Likes

BenoitE&A
Collaborator
Collaborator

Or you can link it to a fixed point rather than your Rebar (the parameter Reference that you use). For this, you can for example create a DetailLine where you want to place your annotation and place it on this DetailLine.

Dirty way, I conceal.


Benoit FAVRE
CEO of etudes & automates
www.etudesetautomates.com/
0 Likes