Automatic sequential numbering

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.

Thanks in advance,

John

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)

-Pascal

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.

Battle_Somme_01.3dm (89.3 KB)

If the text anchor was central I could explode text so that it becomes curves, then move it down to the required position (half the text height).

John

Hi John - the next question is, how do you order the objects? Presumably you do not want to click on each one… are they in a predictable grid?

-Pascal

1 Like

Hi John

How about this script:

SequentalTextNumbers_01.rvb (1.3 KB)

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?

EDIT:

2 Likes

Willem, amazing. Exactly what was required. I wish I could perform such magic.

When we’ve decided on the exact shape (at least rounded corners), font and sizes I shall pass the file onto the client free of charge.

Thank you very much Willem. Also thank you Pascal for making a start.

John

1 Like

Hello forum,

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.

But TextObjects can be used via python-script.

Hope that this is useful

Regards
Ferdinand

1 Like

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.

John

Hi does anyone know if this script still exists? It won’t let me download… Thank you!

Hi zale_orcid,

I found it in an archive:

SequentalTextNumbers_01.rvb (1.3 KB)

-Willem

2 Likes

Hi All,

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)

-Willem

2 Likes

Thats amazing, exactly what I was after.

1 Like

WHY IT DOES NOT WORK?

[image]

Hello,

What error are you getting? Do you have the font ‘CNC Vector’ installed ? Are you using it on closed planar curves?

Best regards,

Graham

1 Like

I can’t download the broken link

Here’s Willem’s original script.

SequentalTextNumbers_01.rvb (1.3 KB)

John

2 Likes

thank you i’m looking for possible script for prefix

Hi,

I updated the rvb to a py version ( my post below the rvb version)
that can add a prefix:

Is that not working for you?
-Willem

2 Likes

thank you so much

[image]

1 Like