Hi,
This is I would do it:
- Search the method in the revit api docs:
AddLeader Method - Find information about the “Leader”:
Elbow Property
End Property - Look for some examples in the revit api forum:
Solved: CREATE LEADER - Autodesk Community - Convert the code into python:
import clr
# Import RevitAPI
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
textNote = UnwrapElement(IN[0])
TransactionManager.Instance.EnsureInTransaction(doc)
for i in range(1,5):
leader = textNote.AddLeader(TextNoteLeaderTypes.TNLT_STRAIGHT_R)
leader.Elbow = XYZ(15, -0.75, 0)
leader.End = XYZ(15, 5+i*2, 0)
TransactionManager.Instance.TransactionTaskDone()
OUT = "Done"
Hope it helps
