I’m currently working on lots of furniture drawings, is there an efficient method to export a cutting list of the panel sizes I will need cutting ? The materials are sheets and generally rectangular in shape, so I need the length, width, thickness dimension of each piece in my model ? It seems a really simple request but I just can’t find an answer to this ! At present i have been grabbing dimensions individually using box edit, it would be great to be able to export to csv the length, width and thickness. At present all i see using this command is is volume, area, etc… :frowningA
If you objects are all boxlike and aligned along the world axes then it’s relatively easy to do… Attached is a sample script that can easily be modified as needed. It exports a .csv (comma used as separator) with each line in the file having
Object name (if there is one, otherwise “unnamed object”)
Length (X dimension)
Width (Y dimension)
Height (Z dimension)
This uses the world aligned bounding box. If your objects are not world aligned or boxlike, then it will not be accurate.
If you need semi-colons as separators instead of commas (Europe) substitute them for the commas in line 29
ExportObjBBData.py (973 Bytes)
@Helvetosaur thanks for the input Mitch. I’ve never had a use for scripts as yet, nor do I know what i’m doing with them, I suppose i better at least learn how to run one, haha :), any tips are welcomed. It’s such a simple task and I don’t understand how this is not implemented in Rhino as a command or export option
Once again, appreciate the reply, cheers
OK, for starters, just to test its function, store the script somewhere on your computer like the desktop, then in Rhino type RunPythonScript at the command line. Then in the dialog that opens, browse to the script and hit OK. The script should run. It will ask you to select some surface or volume objects, then present you with a save dialog that you can name/place your .CSV file. Then it will export the objects and finish. Open the CSV file in a text editor or Excel and see if it is what you want, or if we need to modify the script to format the exported data differently.
Once this is working the way you want, we can go through the procedure to store the script permanently and create an alias/toolbar button for it…
yes that seems to be what I’m looking for, I tend to name my layers and sometimes name my individual objects. Is there a simple way to edit the script so that the Layer Name also appears on the CSV ? I see that column A will display the name of the object if it has been given a name. What are the numbers & letters in column B ? I have attached a small rhino file with a simple piece of furniture to give an idea of what I need to create cutting lists for. I’m working on lots of them, and much larger pieces with 20/30 objects in each model. This may save us a bunch of time Typical Furniture Drawing.3dm (382.0 KB)
Yes, no problem.
That is the object ID in Rhino, an object’s unique identifier - every object has one. It can allow you to identify the object if it isn’t named, but it’s not necessary in your case, so I can take it out.
Col A object name (if it exists)
Col B object layer
Columns C-E - X, Y, Z lengths…
ExportObjBBData.py (1006 Bytes)
Mitch this is already helping . I have notice that it produces a list in the order of objects selected, is there a way to force the script to always produce a list in order of the way they are arranged in the layer panel ?
Yes, that’s doable, I’ll get back to you in a bit…
OK, sorry for the delay, try this one on for size…
ExportObjBBData2.py (1.6 KB)
Mitch, fantastic , very much appreciated, and I’m sure there are a few Rhino users who can put this to good use too. Now I can just copy and paste from the CSV file into the notes in my layouts.
Not sure if this is possible, if there were 2 objects on the same layer, both the same size/dimensions, could you have an extra column in the CSV export file that said, ’ x 2 ', or ’ x 3 ’ if there were 3 identical objects on the same layer ? example- Sides, Layer 1, 300, 200, 18, x2
No worries if this is a step too far, this script is already saving me time
Well, that would add a layer of complexity, because you would need to compare all selected objects on a given layer to all the others and find out if any matches happen in all 3 dimensions; then collect a list of matches. It’s certainly doable, but there is a bit of code involved and it could conceivably get slow if you have a lot of objects - although that’s probably not a real issue as you are not working with thousands of parts it seems…
I don’t have all that much time these days as I’m working on a largish project, but I’ll have a look anyway.
yes my models typically have only 20/30 components when I’m doing this furniture design work. Mitch I appreciate your input already, if you got proper paying work to do totally understand you time is limited. This has already saved me a whole load of time .
Is it difficult to turn this into a tool button or quick access alias command ? I use both windows and mac versions of Rhino
To get around this I use blocks. The way i set it up is the items inside the blocks are aligned with the world axis, the blocks are then placed at the needed rotation. This way if you set up your script to run the bounding box on the items inside the block you will get the correct dimensions. Hopefully that makes sense.
Just put the macro into an alias or on a button:
-RunPythonScript “C:\ _ YOUR PATH HERE _ \ExportObjBBData2.py”
I haven’t worked that bit out yet @wim , I better look it up how to do that
Which bit is that?
For an alias, go to
Rhino Options > Aliases and go to the bottom of the list to make a new entry. Decide on an alias and paste the macro (with the correct path) in the command macro field.
I just put up some more detailed info on setting up scripts to run as aliases or toolbar buttons here - will be happy to edit/add as necessary.
thanks Mitch, sorted it on my Mac at home as an alias, will add to my windows machine at work tomorrow
I just made a quick test with this script on RhinoMac WIP and for some reason I’m getting more results than objects. I will attach the scene used and the resulted .csv file. Why I have more results than objects.
you have all your objects on the default layer, if you assign each object to a layer it works fine,