Layer Standards/ Macros from .CSV?

Ive been gently working my way towards this while trying to wrap my head around all of the relevant features Rhino currently has. In AutoCAD, I have a set of toolbars linked to a single .dwg drawing, which I refer to as our Key drawing. In it, I have all of our typical layers and properties. By referencing this source drawing, it ensures consistency between drawings and projects.
The structure of the toolbar is broken down into two levels: Parent (Called Groups in ACAD, similar to Tabs in Rhino) and Child (Refered to as Toolbars in each). My dream would be to be able to populate each of these for both programs from a single CSV file. My instinct is that the likelihood of achieving that is pretty slim.
In ACAD, developing these toolbars is quite easy. I click create a new toolbar, name it, then drag and drop items onto it. Admittedly, doing this with a 2d program is far less nuanced than it would be for Rhino, and my aim is even higher here. A toolbar called Pipe there would contain a bunch of section views of different sizes, materials, and wall thicknesses of pipe. Whereas in Rhino, my equivalent is a macro for each that looks like this (!-_Layer New “0 Pipe 1.250in sch 40” R “0 Pipe 1.250in sch 40” 159,127,255 _-Layer Current “0 Pipe 1.250in sch 40” Enter Pipe Thick=yes 17.52 21.08 Enter Enter Enter) Creating a new layer with the proper name, setting the layer color by RGB, then generating the pipe to the appropriate dimensions. I currently have about 70 round pipe and tube layers. This is a lot of macros to create and maintain, and is only a portion of around 350 layer standards we currently have. I often open the Key.dwg file with Rhino and just copy items I want into the new drawing, but would love to see a cleaner, faster workflow. My current workflow utilizes buttons at the top of my screen to toggle panels containing toolbars relevant to different tasks, but I am still evaluating what the final product should look like. For example, I have a Pipe Tools Panel that has three tabs so far. One tab to create the pipe and pipe layer, one tab to fillet pipe center lines with a prefilled center line radius that matches each of the dies we have available for each size of pipe, and another to fillet pipe center lines with a prefilled center line radius that matches each of the pre-purchased elbows we commonly use.

I apologize for the lack of conciseness in this post, as the topic is quite a large area to consider, and I am not sure what the best approach is (my dream vs what is reasonably achievable). I guess as of now, my hope would be a way to import macros from a .csv file. One could fill the first page of the spreadsheet with the full list of standard layers and their properties, and then use the following sheets to generate macros referencing the standard layer sheet.

Does this seem like something that could be achieved, or am I off in dreamland? I am open to any and all serious recommendations on more efficient ways of utilizing layer standards or generating macros, but am looking for a somewhat elegant solution that does not feel clunky to use.

If anyone is interested I generated a script that will export Layers, Layer Color, Line Type, Print Color, and Print Width to a CSV file. It will convert the colors from integer to RGB as well as populate the export date, time, file path, and file name. I’m not 100% sure this is the best direction to go to achieve what I’m after, but figure I can walk the path a ways and see how it feels.

I’m not a programmer but tried to do this as cleanly as I could.
LayerPropertiesExportToCSV.rvb (3.5 KB)

Have you thought of using Grasshopper?

I have taken a couple light courses, but honestly I still find it pretty overwhelming. It just doesn’t feel intuitive to me yet. Every time I try to build something the components don’t output what I expect them to. I’m sure with time and more practice I’ll get it figured out, but we stay pretty busy so it’s hard to devote the necessary time. The other obstacle I am considering is the ease of use for others. Ideally a simple set of tools can allow anyone to follow the standards. Along with our engineering dept many of our trade supervisors have access to Rhino. Although I generally don’t expect them to be doing much if any modeling, if it is made easy enough they can at least do some basic things.

Thinking about it I’m really not aware of how Grasshopper would be of assistance in this area. If you don’t mind, I would like to hear your thoughts on it. I’m sure my lack of exposure is severely limiting my imagination for all the ways it could be utilized.

1 Like

Rhino 8 has new components which let you reference files and geometry, modify layers and bake and all sorts of other things.

Can you share a typical *.csv file export?

My intuition and logic both say that sharing the .csv should be fine, but as an employee, I should probably clear it with higher-ups first. There have been some sensitive spots in the past, so I would rather not excite any drama. Things get a little weird when we have different mentalities among different generations of employees, as well as trying to sync workflows with a naval architect who is not in-house and has little desire to change how they have been doing things for a long time.

I really do appreciate any and all assistance and consideration.

Hi @RHammer

I’m having a hard time understanding what you want to do. Is this 2d documentation only?
Couldn’t you just create a Rhino template with all the pipe sizes and specs and go from there?
Why not import the dwg key drawing into rhino and use that as a template? Why create models from macros if they’re already standardized, once created you could just put them in a standard template on the layer where they belong. Perhaps blocks might be a way to achieve some of this.
You say launch a bunch of section views in acad, again for 2d or for the user to choose a specified model?

RM

1 Like

Hi @3dsynergy

I’m not sure how best to explain my thought process, but I’ll give it a try.

The final objective isn’t fully determined yet, as I’m still exploring what’s feasible. We extensively use both AutoCAD and Rhino, and ideally, I’d like them to draw from the same source for layer standards. This would prevent discrepancies between the two programs by ensuring that all new or edited standard layers originate from a single point. I understand this might be an ambitious goal, and I’m still evaluating its practicality.

I have experimented with template files. However, I’m not entirely clear on what “go from there” entails beyond importing them.

So far, running a parallel Rhino instance alongside my active modeling session has proven to be the smoothest workflow, second only to the macro approach. When something is copied into the working model from the parallel instance, the layer name and properties are immediately correct, and any relevant geometry is also available.

Most of our construction standards aren’t simple object copy-pastes. Instead, they are material and design typicals that need to be adapted to each vessel as applicable. The placement of child layers within parent layers can vary significantly from one vessel to another

My AutoCAD toolbars populate with different items. For example, my pipe toolbar mentioned above contains 2D section views of each pipe profile from our Key.dwg. Clicking a button on this toolbar places the specified pipe’s section view into model space, on the appropriate layer, and creates the layer if it doesn’t already exist. This section view can be used as-is for the current drawing view or simply as a guide for drawing lines when a long view of the pipe is needed.

I’ve considered incorporating a “Standard Layers” parent layer into a template file, with categories as first-child layers and specific layers as second-child layers. This structure would speed up layer location and be minimally intrusive within any model. If it was not made obvious previously most of the layer standards I am currently working on are materials and drafting layers.

To illustrate the difference, let’s compare two workflows for modeling handrails composed of 1.250" main rails, 0.750" intermediate rails, and 0.313" plate stanchions:

“Standard Layers” Workflow

  1. Navigate to the 0.313"plate source layer.
  2. Duplicate the layer.
  3. Drag it to the appropriate location in the model’s layer hierarchy.
  4. Rename it.
  5. Make the new 0.313"plate layer active.
  6. Begin modeling the stanchions.
  7. Navigate to the 1.250"pipe source layer.
  8. Duplicate the layer.
  9. Drag it to the appropriate location in the model’s layer hierarchy.
  10. Rename it.
  11. Make the new 1.250"pipe layer active.
  12. Draw the main rail pipe centerline.
  13. Consult an external resource for bending die options.
  14. Fillet the centerlines to the referenced sizes.
  15. Select the centerlines.
  16. Consult the resource again for inner and outer pipe radii.
  17. Run the pipe command and enter the sizes.
  18. Navigate to the 0.750"pipe source layer.
  19. Duplicate the layer.
  20. Drag it to the appropriate location in the model’s layer hierarchy.
  21. Rename it.
  22. Make the new 0.750"pipe layer active.
  23. Draw the intermediate pipe centerlines.
  24. Consult an external resource for bending die options.
  25. Fillet the centerlines to the referenced sizes.
  26. Select the centerlines.
  27. Consult the resource again for inner and outer pipe radii.
  28. Run the pipe command and enter the sizes.

This workflow involves approximately 28 steps and introduces 9 points of manual data entry, prone to human error. Assuming one fillet dimension per pipe size, this includes renaming 3 layers, entering 2 fillet dimensions, and entering 4 pipe dimensions (two pipe IDs and two ODs).

Utilizing Toolbars and Macros Workflow

  1. Click the 0.313"plate macro button.
  • Result: A properly named layer is created and activated at the top level of the layer panel.
  1. Drag it to the appropriate location in the model’s layer hierarchy.
  2. Begin modeling the stanchions.
  3. Draw the main rail pipe centerline.
  4. Click the fillet 1.250" pipe macro button and fillet the pipe centerline.
  5. Select the centerlines.
  6. Click the 1.250"pipe macro button.
  • Result: The pipe is created with the correct dimensions, and the layer is created in the top level
  1. Drag it to the appropriate location in the model’s layer hierarchy.
  2. Draw the intermediate rail pipe centerline.
  3. Click the fillet 0.750" pipe macro button and fillet the pipe centerline.
  4. Select the centerlines.
  5. Click the 0.750"pipe macro button.
  • Result: The pipe is created with the correct dimensions, and the layer is created in the top level
  1. Drag it to the appropriate location in the model’s layer hierarchy.

This approach takes about 13 steps with zero manual data entry.

I’ve explored and tried various other processes that fall somewhere between these two examples. As I mentioned, I don’t yet know the single “best” answer, but that’s precisely why I’m exploring different workflows and possibilities.

Having only been doing this for about two years, I have a lot to learn and am very open to recommendations for clean workflow refinements.

If you have a Rhino template with all these layers already named and ready to go it would seem you could avoid all these steps and it would be less error prone since you’re not dragging layers to the appropriate spot. Number 2 puzzles me because how does a user know where to drag the layer to? Isn’t this error prone? If you want to maintain standards or order how can you allow a user or count on them to drag a layer to the correct spot? Can’t you have this layer created already with the main rail pipe already filleted to the 1.250 instead of going through all those steps? Why not create that layer and have the centerlines already filleted and save all that in a template. Then if the user has to adjust this to a set dimension they merely have to edit that layer. If you use history the stanchions layer could easily be edited and updated, and the user wouldn’t have to drag layers around. Even if they needed to completely change the modeling they still wouldn’t have to create this layer or the initial centerlines and drag it to the correct spot.

Perhaps you need to create a layer standard not as a dwg file but as a spreadsheet that your office can add or subtract from with the proper naming and order of layers and sublayers. Perhaps you can save layer standards both from acad and rhino and then parse them against your spreadsheet to catch errors. To me users dragging layers around sounds like an error prone approach. The spreadsheet would be your key and the office could easily change things like naming and order and it could be mandated to the drawing department depending on your needs.

Also there is the library tab you might place blocks of these models there, then you could drag and drop them into your work. There are many ways to do this depending on your standards. You can do a lot of this parametrically in Grasshopper, might be a good partner but then your modelers would have to know a minimum how to use it. I’d also look into python and or vbscript and csv export and import to control your standards. I’m only suggesting templates because they seem to be the easiest to get what you’re asking.
RM

As of now, our layer structure isn’t too complicated so dragging layers around is not of great concern to me. Usually deck level/ assembly/ material, occasionally an extra sub-assembly.

Yes, I agree that a spreadsheet seems like a good direction to go. I spent a few hours this weekend generating the LayerPropertiesExportCSV.rvb I shared above, thinking that it may be a good start.

I’ll have to think about your recommendations on more template files. At first glance, I struggle to see how premade fillets would be faster than macros when they would have to be oriented to what are often swept rails with varying degrees of final bend angle. We also have multiple dies for many of the pipe sizes, and will use the different radii around the boat to meet different needs. The initial pipe centerline is typically generated as an offset or copy of different parts of the boat, so they could not be properly premade either. I do see the argument for assembly template files to place all of the necessary layers where they belong without needing to drag them around. I struggle with the clutter of excessive unused layers and am pretty liberal with the purge command. This is likely a lot of my instinctive resistance to just preloading every assembly with every potential layer. I will contemplate it further, though, and try to think of better ways I could utilize template files.

Hi @RHammer

I thought that might be the case. If you want to get more help you might create a mock up file and post it then users can give better suggestions.
RM