List with Width, height, lenght and max/min Radius and Length


#1

Hi,

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.

Thanks a lot

Christopher


(Bob McNeel) #2

Try Export to Object Properties (*.csv.)


#3

Good morning,

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.

best regards

Christopher


Spreadsheet for Rhino?
(Dale Fugier) #4

There should be enough example script code laying around for you to write such a file.

Speaking specifically for RhinoScript, here is some samples you might want to look at

Write to Excel files:
http://wiki.mcneel.com/developer/scriptsamples/excel
http://wiki.mcneel.com/developer/scriptsamples/exportblockcount
http://wiki.mcneel.com/developer/scriptsamples/exportpointstoexcel

Write to text file (csv):
http://blogs.technet.com/b/heyscriptingguy/archive/2004/10/28/how-can-i-create-a-csv-file.aspx
http://wiki.mcneel.com/developer/scriptsamples/exportcontrolpoints

Get an object’s name:
http://4.rhino3d.com/5/rhinoscript/object_methods/objectname.htm

Get an object’s volume:
http://4.rhino3d.com/5/rhinoscript/surface_and_polysurface_methods/surfacevolume.htm
http://4.rhino3d.com/5/rhinoscript/mesh_methods/meshvolume.htm

Get an object’s minimum bounding box:
http://www.rayflectar.com/Rhino/RhinoScripts-Gallery.htm

More RhinoScript stuff:
http://wiki.mcneel.com/developer/rhinoscript


(Steve Baer) #5

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()

(Dale Fugier) #6

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).