Move Leader Elbow

Hi Community

I’m trying to move a leader elbow by Setting IndependentTag.LeaderElbow property with a new XYZ. But it throws an exception stating that it cant be moved as long as tag’s leader is straight. Any help will be appreciated!

Straight, elbow position cannot be set.

Not straight, elbow position can be set.
image

import clr

clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

# def

# start
doc = DocumentManager.Instance.CurrentDBDocument
tag = UnwrapElement(IN[0]) # Grab the Tag

TransactionManager.Instance.EnsureInTransaction(doc) # Start Transaction

new_ElbowLoca = XYZ(tag.LeaderElbow.X, tag.TagHeadPosition.Y, tag.LeaderElbow.Z) # make the line horizontal between TagHeadPosition and Elbow position 
tag.LeaderElbow = new_ElbowLoca

TransactionManager.Instance.TransactionTaskDone() # Transaction Commit

#Assign your output to the OUT variable.
OUT = 0

Question.dyn (2.4 KB)
Question.rvt (2.9 MB)

1 Like

@jacob.small @kennyb6 @Vikram_Subbaiah @Alban_de_Chasteigner Any ideas? :anguished:

https://www.google.com/amp/s/dynamonodes.com/2018/03/01/tag-setleaderelbowposition/amp/

3 Likes

Dear sir i use tagining. Its great dyn.
I have 1 questions its working on one tag one time can i select all tag once then i apply this dyn. And change once.
Because i have big drawing i put all tag once then i use align app for align but many tags arrow shoulder looking above image.