I want to be able to export objects (formats of interest are SVG/DXF/PDF) but maintain their order in the exported file. I.e. if I draw objects in the sequence 1,2,3,4 then I want them exported to the file in the same sequence 1,2,3,4. Reason - one application is to export to SVG and then output to an AxiDraw pen plotter from within Inkscape.
I’ve experimented with this in v7, but there does not appear to be any logic to the sequence in which Rhino processes objects for export. I would have thought that it would process them in the order they were created, but this doesn’t appear to be the case. Nor does it follow a “last modified” order either.
The only way around this I found was to put each object into its own layer, then export the lot. The layer order gets preserved (in reverse order) so for small numbers of objects I can do it that way. However, it’s laborious to do many objects - I wrote a script to allow selection in a particular order, then copy to new layers, but even then it’s time-consuming.
Would be very grateful to hear if anyone has some suggestions on this.
Hmm - different behaviour, but still awkward DXF export seems to be based on the order in which the objects were last modified. For example, I create objects 1,2,3, it exports them in the order 3,2,1. If I move object 2 slightly, it then exports in the order 2,3,1 since #2 was the most recently modified.
Lol, that’s just what I was playing with I just wish there was a more automatic way of doing it for larger numbers of objects.
Dim arrObjects, strObject, n
’ Select objects one at a time in the sequence you’d like them exported in
arrObjects = Rhino.GetObjects
If IsArray(arrObjects) Then
’ Go through each object in reverse order, cut and paste in place
For n=ubound(arrObjects) To 0 Step -1
How are you generating the design, is it with scripting inside Rhino? Depending on complexity, it might be possible to port it to something like Processing which can “draw” to an SVG file directly, then use that for the AxiDraw.
Edit: sorry, just realised you didn’t mention generative design, I was assuming you were creating it with a program!
no worries, its is generative (www.instagram.com/tyrer.io), i primarily use grasshopper. My definition is outputting the curves in the order i want them drawn. Its just frustrating that svg export throws it out. I will look into processing.