Is there any way to create a leader from a Textnote to various points using Dynamo or a Python script with the endpoint specified by coordinate(points)?
Hi @jirakrit.tkp is it something here you are after ?
3 Likes
YES! THANKS! But I can’t find those nodes in my library. Can you share with me how it’s done?
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
2 Likes
@jirakrit.tkp Yes sure…that example is with genius loci and rhythm
textnote.dyn (31.8 KB)
2 Likes
Thank you all very much. This has really helped me a lot.
P.S.
I’m a beginner and I want to learn how to use APIs from the basics. Do you have any recommended learning resources? Thank you in advance.