Automatically replicate complex, nested layer structures from another Rhino file. This custom script is ideal for architectural workflows requiring standardised templates across multiple files or teams.
The Recursive Layer Import Tool allows you to:
- Select a Rhino
.3dmfile that contains a predefined layer structure. - Read and replicate all layers, including colours, line types, and visibility.
- Preserve nested sublayer hierarchies by rebuilding them recursively in the current document.
This ensures consistency and efficiency when setting up files for large projects or office-wide standards.
Setting up layers manually across projects is tedious and error-prone. Rhino’s built-in layer import does not always preserve hierarchy or selectively import from files without importing geometry. This tool:
- Automates clean and precise transfer of layer templates.
- Keeps layer hierarchies fully intact.
- Avoids geometry imports or unwanted file content.
Method 1:
- Type
_RunPythonScriptin the command line. - Browse to the saved location of the script and run it.
-
Right-click an empty area of the toolbar and choose New Button.
-
In the Button Editor:
-
Left Button Command:
! _-RunPythonScript "FullPathToYourScript\import_layers_recursive.py"Replace
FullPathToYourScriptwith the actual path to your script. -
Tooltip: e.g.,
Import layer structure from template file.
-
-
Open Tools > Options > Aliases.
-
Add a new alias, for example:
-
Alias:
layerimport -
Macro:
_-RunPythonScript "FullPathToYourScript\import_layers_recursive.py"
-
-
Run the script via command line, button, or alias.
-
Select a Rhino
.3dmfile that contains the desired layer structure. -
The script will:
- Parse the layer tree.
- Reconstruct all layers and nested sublayers into the current file.
- Maintain properties like colour, linetype, visibility, lock state, and hierarchy.
- Layer names and nesting
- Layer colours
- Plot colours
- Linetypes
- Visibility and lock states
- Geometry
- Layer materials
- Layouts or model space contents
This ensures only the structural layer system is brought into your active model.