Text notes for orgin point nodes

Hi everyone,

i am looking nodes for textnotes to get point location.how to get boounding box.


I attached image here.
thanks advance.
hussain

Hey @thsa2501

If you snoop it you’ll get to see that we can that there’s a method GetLeaders which gives us the access to leader properties :- Anchor, Elbow and End locations.


As you are looking for a node to access these properties i couldn’t find one for that but here’s a lil piece of code that i just wrote which will help u get the locations for the same.

def tolist(obj1):
	if hasattr(obj1,"__iter__"): return obj1
	else: return [obj1]

textnotes = tolist(UnwrapElement(IN[0]))

#Do some action in a Transaction
anchorloc = []
elbowloc = []
endloc = []
TransactionManager.Instance.EnsureInTransaction(doc)

for note in textnotes:
    leaders = note.GetLeaders()
    anch = []
    elbo = []
    end = []
    for lead in leaders:
        anch.append(lead.Anchor)
        elbo.append(lead.Elbow)
        end.append(lead.End)
    anchorloc.append(anch)
    elbowloc.append(elbo)
    endloc.append(end)
        
TransactionManager.Instance.TransactionTaskDone()

OUT = anchorloc,elbowloc,endloc

Hope it resolves your doubt.
Regards,
BM

1 Like

Hi bharat,
thanks for the reply. I checked your code in dynamo. It’s getting error’s find attached image.
thanks
hussain
Screenshot 2024-02-19 114759

hi bharat,
i got it. lot of thanks…

1 Like

Glad you got it. I posted the code without Boilerplate Code.

Happy you resolved it.

1 Like