Convert text to dot

Hi Bill, you’re probably where running different code. The last one posted collects the text dot text and locations and pops up a dialog showing you that in a dialog from which you can save or copy to clipboard.

Here is one which collects the dot text and positions and prompts you to save to csv:

SaveDotTextPositionAsCSV.py (1.0 KB)

Each line is formated like this: textdottext, x, y, z

_
c.

BINGO! :grinning:

Thank you so much clement!

Hello, can I ask for help? I need simple scrip that will move text objects to Z coordinate that is the text itself.

Context: I received site survey that includes dots and each dot has text (for example “188.08”) that represents the height (Z coordinate) of the point. But all of them are in 0 at the moment.

Can a script move them in the appropriate Z height using the text as input?

Maybe try this quick hack…

MoveDotsToTextHeight.py (910 Bytes)

Or maybe you need this one, after rereading it’s not clear if you have text dots or points that have a text next to them…

CreatePointsAtTextHeight.py (1.1 KB)

I’m going to be out for the rest of the afternoon, so I can’t fix any of this until later…

Something like this works:

import rhinoscriptsyntax as rs
import Rhino

def MoveDotsToTextHeight():
objs = rs.GetObjects(“Select text to transform”,0,preselect=True)
for obj in objs:
x, y, z, = rs.TextObjectPoint(obj)
z_coordinate = rs.TextObjectText(obj)
rs.TextObjectPoint( obj, [x,y,z_coordinate] )
MoveDotsToTextHeight()