When I ran this code, it kept the same z coordinate. What I want is for t

I want to raise a height post on the z axis by its amount. There are hundreds of posts at the same time. It is very unreasonable to do it one by one

are they all the same height? But sounds like a good use for grasshopper

No, they all have different heights. Elevation inscriptions of the land.

You could reference them in grasshopper and get the bounding box from them evaluate the height in z and move them by that amount in the z direction

Try This:
Move_Object_Vertically_Its_Own_height.gh (5.9 KB)

The z coordinate of all these texts is 0. And the z coordinate that should be written on it is

When I ran this code, it kept the same z coordinate. What I want is for the text 219.46 here to be (a,b,219.46) from the coordinate (a,b,0).

You haven’t posted any geometry? How can you expect a solution?

3. Attach minimal versions of all the relevant files

Oh wait, this thread has been solved? Moving on…

1 Like

Yis some file to actually help you would be great. Its a bit unclear to me how you ended up with this

I did it with a friend but it doesn’t work

I see, I was assuming the objects to be moved had volume. Try running this script in ScriptEditor (The command is either “RunPythonScript” for Rhino 7 or 6, or “ScriptEditor” for Rhino8

########################################

import rhinoscriptsyntax as rs
import Rhino

allObjs = rs.ObjectsByType(0)
for obj in allObjs:
    if rs.IsText(obj):
        mag = float(rs.TextObjectText(obj))
        rs.MoveObject(obj, [0,0,mag])

###############################

I couldn’t run it, could it be me too?

What version of rhino do you have?

Right now I have rhino 7 and 8. The version you threw is 7 also gives an error. Version 8 also caused my computer to freeze.

Try this in Rhino 8
Move_Text_Object_By_Displayed_Value.gh (6.9 KB)

Thank you very much