3D Text in Rhino for Mac via Python?

Hello everyone,

I’ve been trying to add 3D text to Rhino using Python Script.

After searching a lot, I’ve found how to make annotation text, and a few threads (e.g. http://www.rhinoscript.org/forum/1/13) have suggested that I can create curves from exploded annotation text. When I explode annotation text in the GUI, the text disappears entirely, which doesn’t seem like the generally recorded behaviour.

I’ve tried using the ExplodeText function from the utilities.py package. Though I don’t get any errors, my annotated text simply disappears and if I log curves, I receive only empty arrays.

I’ve also tried using the TextEntity function rather than the AddText function (not sure if there’s any difference), but no text appears.

I’m fairly new to Rhino (which you likely guessed), and I’m at a bit of a loss. This (http://wiki.mcneel.com/developer/scriptsamples/converttexttogeometry) example suggests that there might be a TextObject function (for geometry-based text), but I can’t quite find the Python equivalent.

Any ideas would be much appreciated!

Edit: This (AddTextObject?) seems promising. After removing all parameters to the command other than “-_TextObject”, I’m drawing text objects okay. Still need to figure out extrusions and whatnot but this is a promising start.

i’m wondering if there’s something not quite right with the dashed version of the _TextObject command in mac rhino?
if you run the command in mac rhino (not via script), you’ll get all the options for font/size/extrusion etc… but when you run the dashed verison (-TextObject), you can only define an insertion point.

that said, i’ve never seen either the dashed or regular version of TextObject being run on windows so i don’t have anything to compare to :wink:

Exploding text is not working correctly - as you have discovered, exploding text deletes it: certainly not the expected behavior :frowning: This is a known issue (MR-1022) and we are looking into a fix.

Thanks for your response! You’re correct that I can only define an insertion point. Any ideas for a work-around so that I can specify text content and height as well?

I was looking at this: http://wiki.mcneel.com/developer/rhinocommonsamples/edittext and was wondering if there was a way to draw text and change attributes after (though this may be for annotation text… Rhino is definitely not my native language).

Thanks for getting back to me! I’m still figuring out where the best McNeel resources are and I’ll make sure I keep an eye on this page for future sanity checks. This is both Mac and PC?

I’ll also ask you what I asked jeff above: Any idea for a work-around in the meantime?

Had to fire up my Mac to check this - yes, this definitely appears to be wrong, you don’t get any options at all. On Windows I get this:

Edit: I figured it was worth trying to create a bug item for this - my first attempt at this (hope it’s OK):
http://mcneel.myjetbrains.com/youtrack/issue/MR-1062

–Mitch

Edit: I figured it was worth trying to create a bug item for this - my first attempt at this (hope it’s OK):

Perfect! Thanks Mitch.

This is both Mac and PC?

The “exploding text not working” bug (MR-1022) is Mac only. Things are working as expected on Windows.

I’ll also ask you what I asked jeff above: Any idea for a work-around in the meantime?

It’s a little discouraging given the TextObject weirdness that @jeff_hammond and @Helvetosaur discovered. That said, I don’t know exactly what you are trying to script with the -TextObject command, but given it’s lack of options (at the moment), I’m at a loss. I’ll look into both bugs this week.

While you’re at it, @dan, there is also a bug in the Text (not TextObject) dialog. Actually a couple of bugs…

Type Text to start the command. Pick an insertion point. The dialog comes up.

Bug #1: The text SIZE box is active, not the type-in-your-text window. This leads to bug #2

Bug #2: You can actually type TEXT into the SIZE box, not just numbers. It will give you an error message, but it shouldn’t let you type anything but a number here…

To resume, the dialog should come up with the text-entry box active (with previously entered text string already highlighted if there is one), and the size box shouldn’t let you enter anything but numbers.

I have to go home now, so I’ll let you create the bug item this time… :smiley:

Edit: @dan, @marlin, I created the bug, http://mcneel.myjetbrains.com/youtrack/issue/MR-1063
–put in “Text” for subsystem, hope that’s OK…

–Mitch

1 Like

Perfect! Thanks again…keep em coming!