Is there a way to set a layer’s print width from the objects it holds?
E.g., if one layer had 100 curves each set to 0.1mm, is there a command which can assign 0.1mm to the layer? Perhaps it could take the average, min or max print width.
Likewise, is there a command which can assign a layer’s print width to all of its contained objects?
Both of those are easily scripted, the second one being simpler because there is only one value to consider. For the first you would need to decide between the choices you outlined if the pw values are not all the same. Also as object settings override layer settings, going from by object to by layer would require removing the individual objects’ pw settings permanently… or maybe not, it could assign the value to the layer, but leave the individual overrides.
Hi Helvetosaur;
The way you responded sounds logical indeed. I was also thinking of the object level overrides.
Can you direct me on where I should start on how to learn to script like this? They haven’t taught us custom scripting at our school haha.
I wish I had the time this morning to script it and explain, unfortunately, I’m traveling for the next few days. I can look at it tonight when I get where I’m going, or perhaps someone else in here will respond before that.
Has a couple of minutes to spare, here are two starter scripts:
The primary reason for the object to print width was to be able to automatically take print widths of objects when importing/opening a RhinoPDF, and assign them back to the layers which were used when creating the PDF.
The layer to object script was to try to simplify the GH Print Width Preview script; and both together would allow seamless transition between both.
E.g., this was a section perspective exported to RhinoPDF at 1:50. When I import that same pdf; scale it back up 50x, the print widths on the objects are retained. But the layer print widths are reset to Default, and the layer colours use what were the print colours of the original export.
I tested it and it seems to work for many nested layers. The print width is maintained on the objects, but it’s easy to select all and set to By Layer.