is it possible to create a file (text, csv, excel, whatever) with this datas? We have to measure everything manually and write it into a excel file via copy-paste, thats horrible. It would be great if it could be able to get a list with name and al the parameters of a part…
Is this possible with a script or a plugin???
I really hope that there is a good solution for me.
yes, I know this function, but the csv-file is no solution for me.
I need the measurements of the boundingbox of each part. For example a beam or a plate have many cuts and drillings, but in my list I need the geometry of the bounding-box, because my beams must glued by this geometry.
So it would be nice, if i had a function which allows to activate all parts and the output-file is a csv-file with:
Name
Pieces
Width (bounding-box)
Hight (bounding-box)
Length (bounding-box)
Volume (real part)
Volume (bounding-box)
This would be a list, I can Import to excel an produce the parts. At the moment I export everything into another cad-system to get position-numbers and a list of the beams.
Here’s a quick sample in python that could serve as a start
import rhinoscriptsyntax as rs
def ExportObjects():
filename = rs.SaveFileName("Filename", "CSV Files|*.csv||")
if not filename: return
object_ids = rs.GetObjects("Objects to export")
if not object_ids: return
f = open(filename, "w")
f.write('name, x, y, z\n')
for id in object_ids:
name = rs.ObjectName(id)
if not name: name = "unnamed"
bbox = rs.BoundingBox(id)
x = bbox[6].X - bbox[0].X
y = bbox[6].Y - bbox[0].Y
z = bbox[6].Z - bbox[0].Z
f.write('{0}, {1}, {2}, {3}\n'.format(name, x, y, z))
f.close()
ExportObjects()
This is a great start. But I believe he is looking for a minimum bounding box. Imagine some object, perhaps an extruded I-beam, that is not aligned to the world-xy axis. He is wanting the minimum bounding box around this object or any arbitrary solid (I think).