Text Formula for Z height?

Hey there,

I have an annotation dot for which I would like the text to contain the Z position of the dot. Is this possible?

Cheers,
Adam

Hi Adam,

Run the following script and pick up the annotation dot you want to change:

import rhinoscriptsyntax as rs

id = rs.GetObject("Pick annotation text dot")
if rs.IsTextDot(id):
    oldText =  rs.TextDotText(id)
    zCoor = rs.TextDotPoint(id)[2]
    newText = oldText + " %0.2f" % zCoor
    rs.TextDotText(id, newText)

It will add the z coordinate value to your present annotation text dot.

If I misunderstood you, and you want your annotation text to have only the z coordinate value, then just replace the next-to-last row with this:

newText = "%0.2f" % zCoor

OK, i forgot to mention Something ^^ I need the Text to update dynamically, just like a Dimension text. Silly me…

I do not think I understand you.
You have a points, and then you add an annotation dot text to those points.
What you would like to do is to move those initial points - and to force an annotation dot text to follow their z coordinate as well?

exactly. Is there a way to accomplish it?

Drop the attached button to your Rhino 5 workspace:
textTag.rui (6.1 KB)
Right-click on “annoZ” button, will allow you to create an annotation dot text objects for selected points.
After you do this, you can move the initial points as you wish. Each time you want to update the label values, just left-click on the same button.

Left-click will always update only those annotations you created using the right mouse button. Not other ones (created by using some other scripts or Rhino’s “Dot” command).

6 Likes

Have same issue/wish as adam and I hope that your solution is what I am looking for. Will test it tomorrow when I am in the office.

It works, this is great although I have a question: Is it possible to adjust/change the typeface and the style of the displayed height? I would want to change the black background box and also change the height text.

Hi @Domen,
Have you looked at this topic?

2 Likes

Please don’t triple-post…

Well I am sorry did not know it is not allowed to reply on different posts with similar topic. I decided to make my own post due to other posts being old and didn’t seem active.

1 Like