Hide leader line from RoomTag, how?

Hello,

How can I hide a leader line from a room tag?

OUT = UnwrapElement(IN[0]).get_Parameter(BuiltInParameter.LEADER_LINE).AsString()

I can access it! is this correct? In a ideal way, I just switch on/off the visibility of leader lines.

I think AsString is wrong. how can i say hide/unhide?

The idea is to have boolean, because i want to see later where the room tag come from.



https://www.revitapidocs.com/2016/6b0ae8d1-776a-ad0d-577d-ffdc11673019.htm
https://www.revitapidocs.com/2016/887010c4-de58-96b6-0931-4c226e6b142b.htm
they use it for elements, not for a roomleader, but could it work?

Thats the wish a traditional floorplan with separeted roomtags
2020-09-01_13h13_32

KR

Andreas

Hi @Draxl_Andreas,

I think you should look at this property from the SpatialElementTag class.

The problem is when i switch of the leader, the tag loses his host…

… i want that the tag is still hosted! but with a “invisible” leader

Could be a option to give the leader line a color like white or (255,255,254)?
or a line pattern?

@Draxl_Andreas, try like this?

leader_line = UnwrapElement(IN[0]).get_Parameter(BuiltInParameter.LEADER_LINE)
leader_line.Set(0)

Ah i see what you mean now. If you turn of the leader, the tag is moved into the room. Lol :slight_smile:

1 Like

is this one line? or do i separete it ?

leader_line = UnwrapElement(IN[0]).get_Parameter(BuiltInParameter.LEADER_LINE)

y = leader_line.Set(0)

OUT = y

2020-09-01_14h01_03

OUT = UnwrapElement(IN[0]).get_Parameter(BuiltInParameter.LEADER_LINE)leader_line.Set(IN[1])

or this way?

This is only going to turn the leader off and move the tag back to the room. The only way to adjust the leader line is to use Object Styles under the Annotations category. You can adjust the Linework, Weight, and Color, but is not an option here.

Basically you can’t have a room tag without a leader that isn’t in the room.

@Draxl_Andreas, first way more appropriate , and put your transaction.

1 Like

…but it overwrites all.

so can i access just the leader?

… i can solve it with a subcategory… thank you! for thinking outside the box or coming back from thinking outside the box :slight_smile:

deep fake :slight_smile:

@Draxl_Andreas, complete code will be something like this

# start transaction
TransactionManager.Instance.EnsureInTransaction(doc)
leader_line = UnwrapElement(IN[0]).get_Parameter(BuiltInParameter.LEADER_LINE)
leader_line.Set(0) 
# transaction done
TransactionManager.Instance.TransactionTaskDone()
OUT = "anything you want"
1 Like
leader_line.Set(0) 

can i write leader_line.Set(IN[1]) and using bool i mean True/False, now it worked just 0 and 1

Thank you! but, the room-tag jumbs back… overwrite not bool is the way

hey, I know it’s been a while. We are facing the same issue, we want to basically hide the room leader lines, without the tag jumping back to the room.
was there a solution which worked in the end with the API?