Hello. I have been trying to expand my programming knowledge by using Python nodes to access RevitAPI within Dynamo. I am currently stuck on how to access the location of the point circled in red in the picture below.
I have been looking into Revit’s API extensively and cannot find any reference to that point. I have also been trying to use the height of the total textnote and just halving it but to no avail. It has no boundingbox attribute.
The goal is to redo all the leaders on selected textnotes so that the angle at the elbow is always 135 degrees. I am almost done except that the line between the elbow and TextNote is not horizontal. The python script is messy and has unused variables but I can clean it up after it works. Any info would be greatly appreciated!
from Autodesk.DesignScript.Geometry import *
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Plumbing import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
#The inputs to this node will be stored as a list in the IN variables. doc = DocumentManager.Instance.CurrentDBDocument textNote = UnwrapElement(IN) textType = textNote.TextNoteType textSize = textType.GetParameters('Text Size') TransactionManager.Instance.EnsureInTransaction(doc) textLoc = textNote.Coord textW = textNote.Width textH = textNote.Height textX = textLoc.X textY = textLoc.Y leaderStart = XYZ(textX,textY,textLoc.Z) leader = textNote.Leaders leaderEnd =  for i in leader: leaderEnd = i.End j = leaderStart.Y-leaderEnd.Y elbowX = leaderEnd.X-j elbowY = leaderStart.Y leaderElbow = XYZ(elbowX,elbowY,leaderStart.Z) textNote.RemoveLeaders() newLeader = textNote.AddLeader(TextNoteLeaderTypes.TNLT_STRAIGHT_R) newLeader.End = leaderEnd newLeader.Elbow = leaderElbow TransactionManager.Instance.TransactionTaskDone() OUT = 0