Automated Component Creation
-
Does anyone have a way to create similar components from a spreadsheet or csv file? Many of the spec's are the same, would need unique names, etc?
Any general help with exporting data in csv form needed, such as the option to change the file name each time. Is there a way to export the data and link to it from a unique Excel workbook, without opening the source file?
-
See ComponentReporter++, CutList etc for examples of CSV export...
There are also several similar tools that allow you to choose a folder/filename withUI.openPanel
.
You can insert a consistently named CSV into an Excel XLS and format it, any changes in the CSV are updated in the XLS...
If you structure your CSV logically so that the data in each line is readable then exporting it back into another Ruby should be relatively straightforward...
So, for example you have a face that's exported, list its corner vertex xyz positions, layer, layer_name, attributes etc etc.
When you import it you dread it line by line, the first field of the CSV tells you its a 'face', so then you expect vertex-positions so read those, turning them into numbers with to_f, each set of three of these gives a point [x,y,z], next when you get to a field called 'layer' you know the point sets are done and the next point will be a layer-name etc etc...
face=entities,add_face(points_array) face.layer=layer_name
etc etc
Advertisement