I’ve been asked if I can draw nearly 20,000 identical shapes each of which will be numbered. They’ll probably be laser cut and each one will be laser etched with a unique number - the first with a “1” all the way through to the last with a “20,000”. I’m not keen to do this by hand and wondered if there was some way to automatically sequentially number shapes.
Hi John- I have written one or two scripts that do something like this, I’ll dig through and see what I can find- am I correct that you want the numbers as curves? Where on the part should this number appear? Can you post or send me an example? (maybe not all 20,000)
Thanks Pascal. It was suggested that the shape might be as simple as a 3" x 1 1/2 rectangle. Numbers as curves would be best. Ideally the centre of the number would be on the centre of the rectangle/shape.
For the curious - it’s part of a commemoration of the 19240 soldiers who died on the first day of the Battle of the Somme.
It will ask you to select a number of curves that then will be numbered in sequence.(arbitrary order)
The text is inserted on the centroid of the curve and justified middle,center
To run the file, either open in via the Rhino Scripteditor and run it from there.
Or just drag and drop the .rvb file over Rhino.
The script will then run once and you need to drag and drop again to run it again.
The script file can be opened in notepad for editing:
I included a couple of variables that you yourself need to set. Dim TextHeight: TextHeight = 2 Dim FontName : FontName = "Times New Roman" Dim Explode : Explode = True Textheight is now set to 2 but you need to set the size in file units as you like Fontname is the Font you like to use. The Name needs to be set exactly as stated in the font list and encapsulated in double quotes Explode is a toggle to explode the text objects to outline curves or not. This can be set to either True or False.
Please test the script on a file copy and be aware that processing 20.000 objects can be slow.
The script itself is fast but:
For instance I tried to change the font by selecting all 20.000 text objects and set them to another font,
it took ages to complete.
Does this go in the right direction?
EDIT:
I included a 100 separator as in your exaple.
It’s set to be a comma ( , )
-Willem
@pascal have a look at this please. Should it take so long to change the font for many textobject via properties where a script does it in a whimp?
just signed up to send this.
Maybe not a good idea to use exploded text created by “Text”-command. Have a look:
exploded text is not looking nice.
Only “TextObject” creates good curves in Rhino.
Unfortunately there is no “AddTextObject” in RhinoScript (wish!).
Unfortunately curves are not closed in this font (times new roman) so one would have to redraw the single letters using a font editor.
Thanks for reminding me of that Ferdinand. I have noticed this happening with some fonts, but I think if we choose the right font, and give that we’re laser etching rather than cutting I think we’ll get away with it.
As per email request, here’s a version in python that lets you adds a prefix to the text.
canceling the prefix dialog will get you no prefix. prefix_sequential_texts.py (1.0 KB)