Hi, i wonder if it is possible to load a preset of layers from a file? The layer state manager seems to be the right tool for it... export a preset and load all layers with properties to your file. That would be great! Is it possible?? And can you build a rhino common method for it? ;)
Hi Johannes - I suppose the simplest would be to use the
command (with the dash in front "-") in a script or a macro.
! -_LayerStateManager _Import "Full path to .lay file" _Restore _Enter
something like that- I have not experimented much....
Hi Pascal, the command script would be fine for me. But it doesn't work. I can save a layer state into a *.lay file and i can import and restore that file. I don't see any of the layers... They seem to be there because i can save them in a new layer state file.... Maybe you can take a look on it.
I will write my own *.lay-importer for now. The *.lay is perfectly prepared for it ;)
Here is the LayerState file:
Hi Johannes- the layer state manager does not create layers if they do not exist... it only sets the state of layers. So, here, this works for example:
! _-LayerStateManager _Import
if the layers in the .lay file exist in the current Rhino model.
Does that make sense with what you are seeing?
Hi Pascal, the LayerStateManager is doing his job. I was looking for the options to import not only the properties for existing layers. How many companies have a defined layer systems with sub layers, colors, print details,... ? In best case you start with a empty template with all your layers. Then you don't need the layerStateManager because it is all ready prepared. But when you start with an existing model you need to import your predefined layers and not only the option to change the layer properties. I mean you have all Informations in the config file (*.lay) wouldn't it be nice to have the options to import the whole layer tree? An extra option inside the layerStateManager?
Right now we export the layer preset with the layerStateManager and we import all nessesary layers with our own layer importer from that file.
for different tasks I have prepared EMPTY (no objects) 3dm files with layers defined inside.
When needed, I just import such a file into my working model and a set of layers is added.