import rhinoscriptsyntax as rs
block_name = "BlockName"
coords = "X,Y,Z" # Change to "X", "Y", or "Z" as needed
dynamic_text = '%<PointCoordinate("{0}","{1}")>%'.format(block_name, coords)
base_point = (0, 0, 0) # Starting point for the text
text_height = 1.0 # Text height in model units
text_object = rs.AddText(dynamic_text, base_point, text_height)
block_name = "DynamicAnnotationBlock"
if text_object:
rs.AddBlock([text_object], base_point, block_name)
print("Dynamic annotation block created successfully!")
else:
print("Failed to create text object.")
Thanks for this @farouk.serragedine. Forgive my ignorance but would you be able to share a step by step ‘for dummies’ breakdown of how to use a routine like this? Would it be saved as a .txt file then dragged into the command line…?