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? ;)

 

Johannes

Tags: import, layer, manager, state

Views: 63

Reply to This

Replies to This Discussion

Hi Johannes - I suppose the simplest would be to use the

-_LayerStateManager

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....

-Pascal

pascal@mcneel.com

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:

[LayerStateRGB]
Current=Default
Layer0=Default;0;1;0;-1;0;0.00;1;0;1;0;0;0.00
Layer1=red;255;1;0;-1;255;0.00;1;0;1;255;255;0.00
Layer2=green;65280;1;0;-1;65280;0.00;1;0;1;65280;65280;0.00
Layer3=blue;16711680;1;0;-1;16711680;0.00;1;0;1;16711680;16711680;0.00

 

 

johannes

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

"C:\Users\pascal\Downloads\_Tech Support\LayerState.lay"

_Restore _Enter

if the layers in the .lay file exist in the current Rhino model.

Does that make sense with what you are seeing?

-Pascal

pascal@mcneel.com

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.

 

regards,

Johannes 

Hello, 

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.

RSS

Translate

© 2013   Created by McNeel Admin.

Badges  |  Report an Issue  |  Terms of Service