Formatting import CSV file for Excel generated import to RHINO

I have spent countless hours in an effort to understand the record layout of the Excel generated CSV file fro import into Rhino and while I find a great deal of information about the export of Rhino to Excel, I have so far, not come across a sample of the CSV file that will transfer into Rhino.I am looking specifically for the import into RHINO of the ;record layout as it illustrates(1) Layer Name, (2) X, Y, Z coordinates and, (3) view or plain information.

At the present time I am well into the task of having excel properly generate the layer/level names as well as the coordinates that must be computed from geometry specs
Your help in getting me off on the right foot would be most appreciated.

Thanks,

Peter

You cannot import anything but points (x, y, z coordinates) with a direct import of a CSV file in Rhino.

For anything more sophisticated than that, you need either a small script, or to set up the CSV/Excel file with the appropriate Rhino commands and use ReadCommandFile command in Rhino. A script is generally easier to control and customize to your liking.

Do you have the exact formatting of a single line?

as in: layer; x; y; z; view

It’s easy enough to read a line, create a point at x,y,z and put it on a later. OTOH, I’m not sure what you want to do with the view/plane info…

–Mitch

Thanks so much for your assistance

That is correct. The only thing the native Rhino CSV importer can do is import coordinates to form points.

Again, I’m not quite sure what you want here. How is the view supposed to be interpreted? What is its function?

–Mitch

Your clarification is appreciated. On the matter of the “views” let me attempt to explain:

The operation with which I am working can -and has - router cut sheet goods to produce for a single job 35 thousand pieces with each piece requiring a label or mark to be placed on the vertical ends or sides of each cut piece. Currently this is a manual task but we have moved closer to automating the step in Mastercam. Mastercam support has advised that for the labelling functionality to be engaged, in cases where the “end” is to be marked, then that geometry -X,Y,Z must go to (1) the appropriately named level and, the correctly named “view”. (Unless Mastercam “can see” the side to be labelled, then the functionality is not available).

I should mention that Rhino is sbeing used as the conversion step from the Excel/CSV file to DXF and Mastercam has confirmed that the file translators for Rhino are supported.

OK, levels in Mastercam = layers in Rhino, so that shouldn’t be a problem. However, a point is just a point in space and does not need a view, so I assume that the idea is to insert a text label at the specified point that is “facing” the appropriate view? That might be possible, but there somehow needs to be a direct correspondence between Mastercam’s view system and Rhino’s. The other problem is that views in Rhino are just names and as such change with the language the program is in. Anything that relies on view names is thus unreliable in a multilanguage situation.

One neat way to avoid all this would be to use a vector that indicates the direction the text should be facing, i.e. [1,0,0] for facing along the X-axis, which would read correctly in Right view; [0,-1,0] to face along the Y-axis (Front view); or [0,0,1] for Top view…

Plus, of course, you would also need the text string that you want to mark on the object in the csv file on the same line as the coordinates as well…

–Mitch

Great information and thanks so much. I’ll let you know how things come together -in a few week or so.

Peter

OK, no problem, if you manage to put together a csv file formatted something like this:
x, y, z, layer, vector_x, vector_y, vector_z, label_text
Then it should be easy to script the import. Maybe you also need a text label height or something…

–Mitch

As I experiment with a CSV file, using as an example -metric- X=800,Y=400, to get the four corners of the rectangle to show as points, it seems that I must show the four XY co-ordinates and line connect to close the shape. . If I import an excel file via rhinoscript, can I enter the X and Y of 800.400 only, or will I need to build in the excel sheet for each such rectangle geometry a table showing four rows being each of the the four sets of co-ordinates with each pulling to the same layer and then,…rhinoscript the line joining of the four points? If I must show the four sets of co-ordinates I can script such in the preliminary stag.

The rectangle 800 x 400 has to be put somewhere. If you don’t have absolute coordinates of the 4 corner points, you could extrapolate them in the script from an origin point and length/width - assuming you also have a plane in which the rectangle must lie. But you need at least one 3D point as an “insertion point”, otherwise your rectangle is meaningless.

For simplicity, I suggest one “column” for each x, y, and z coordinate. So you could get away with lines something like:
X, Y, Z, Length, Width, Layer, Text. Of course, remains the problem of how the text is to be facing - as per my posts above, I don’t know how that needs to work with MasterCAM.

–Mitch

Thank you again for your suggestions; as in one very large and complex job we had 35 thousand pieces cut and stacked on pallets, your suggesting a means around the otherwise multiple rows is a big help.

Peter

We have rectangles building in Rhino, being saved as DXF and opening in good form in Mastercam . The data being built in excel is shown now -a composite of your earlier guides:

If I am reading "Entering a numeric distance after selecting the start point in the Line command constrains the length of the line, whatever location you choose for the end point. " this correctly, I need pass only one line of X,Y,Z data to Rhino and then can connect thru the "line process as indicated utilizing Length and Width.
Please let me know if I am on the right track?