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

@JacobSmall @kennyb6 @Vikram_Subbaiah @Alban_de_Chasteigner Any ideas? :anguished:

3 Likes