Rotate multiple text objects

Hello,
I am using Rhino 6 to prepare nesting files to cut Aluminium sheets of 6x2 meters and we are able to print text on these plates, but only 0-90-180-270 degrees. A typical sheet has +/- 100 texts in all different orientations.
I would like to be able to rotate all these text objects with different angles to 0-90-180-270 degrees , which ever is the nearest (so max. 45°), around the centre of each text object.

Is there a way to do this with a command or maybe a Macro?
Thanks in advance for helping out.

Gr. Willem-Jan

Two quickie scripts that might do the job -

RotateTextsToNearest90.py (778 Bytes)
RotateTextsBBToNearest90.py (820 Bytes)

The first rotates the texts to nearest 90°around their insertion point, the second rotates the texts around their bounding box centers. Not extensively tested, let me know how it works for you.

Thanks for the quick reply and the both files!. I have tested both, but I think they need some work. Attached a text file which needs to be rotated to test.Rotate text.3dm (381.0 KB)

Hi Willem-Jan,

I had a quick look at Mitch’s script for BB rotation.
There is an issue with rotation direction causing some texts indeed not to rotate as expected.
See if the attached script works better for you:
[RotateTextsBBToNearest90_WD.py|attachment] (1.2 KB)

RotateTextsBBToNearest90_WD.py (1.3 KB)

Groet
Willem

Hi Willem,

This looks like it works a whole lot better. Only thing I notice is that some text which are almost at the right angle will be rotated almost 90 degrees. Is there a way to limit the rotation angle to max. 45 degrees? it is no problem if a text ends up side down.

Gr, Willem-Jan

Hi Willem-Jan,

I replaced the script in the above post with a new one to handle cases where the tested angle was greater than 90 degrees (reversed directions of test axes)

It seems to work as you want.

Groet Willem

PS Also a link here:
RotateTextsBBToNearest90_WD.py (1.3 KB)

Thank you very much. It works perfectly now.
Thanks to Helvetosaur and Willem Derks for the quick solution.

1 Like