Hi All,
I was trying to move leaderEnd of multiple tags, im not getting any errors but it’s actually doing nothing. Any idea?
Thank you.
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
items = UnwrapElement(IN[0])
points = UnwrapElement(IN[1])
elementlist = list()
TransactionManager.Instance.EnsureInTransaction(doc)
for item in items:
try:
elementlist.append(item.LeaderEnd.ToXyz(points))
except:
elementlist.append(list())
TransactionManager.Instance.TransactionTaskDone()
OUT = elementlist
It seems like you are not setting anything currently. Here is what I managed to get with a little tweaking:
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
items = UnwrapElement(IN[0])
points = UnwrapElement(IN[1])
elementlist = []
TransactionManager.Instance.EnsureInTransaction(doc)
for i in items:
for p in points:
try:
i.LeaderEnd = p.ToXyz()
elementlist.append("Success")
except:
elementlist.append("fail")
TransactionManager.Instance.TransactionTaskDone()
OUT = elementlist
1 Like
And another option if you didn’t mind using Rhythm nodes:

2 Likes
Many thanks John, I believe these are new update from the package never seen them before.
1 Like