Dynamic Spot Coordinate, Spot Elevation, X,Y,Z annotation blocks for R8

Been meaning to upload these nice dynamic annotation blocks @wim gave me a tip about -

Spot Coordinate & Spot Elevation Blocks.3dm (104.3 KB)

Feel free to customise.

How to make the dynamic annotation component/s:

  • Run Text
  • Paste this: %<PointCoordinate(“Block”,“X,Y,Z”)>% (delete X,Y,Z as required)
  • Turn the text into a block
2 Likes

Note that pasting in the forum creates curly quotes that need to be replaced with straight quotes when pasting back into Rhino.
-wim

1 Like

Hi Hugh,
Maybe this routine will help

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.")

Farouk

1 Like

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…?

@wim I am wondering whether there might be a way to use this dynamic block function to create a slope annotation tool…?