Jump to content

LAS (Layer State Manager ) to freeze layers over all layout-viewports


OMEGA-ThundeR

Recommended Posts

Hi,

 

Situation:

 

Heavy 2d model drawing, multiple xref that get edited in between. multiple layouts (lets say 25). And multiple viewports (3 for scale model view, 1 for legend, 1 for overall view (scale 1:50.000)) per layout.

 

So, now i add some new layer that i don't want to see in the overall view (its not detailed enough, so no use in to show data and make the layout 'heavier' than it needs to be), but i do want to see it in the scale model views.

Setting the new layer to be frozen in the viewport by default makes me need to turn it on again on those viewports.  Long story short, going through 25 layouts to do this will take an hour and a lot of frustration.

 

Coworkers keep talking about 'LAS file' for setting this up, but my understanding of this 'layer state manager' is limited to a level that i don't think this will do the job. 

At least, how would that manager know what viewport is has to apply any layer states to if it can't be defined.


Going manually through all the layouts ain't the problem, besides some lisp my fastes sollution is to fix 1 viewport, make a block of it to copy to other layouts, explode that viewport and use the 'Match Properties' command to copy the settings from the copied viewport to the other 3. And do this 25 times total for all viewports.
Saving time by unloading all the xrefs to fasten the process of loading in the layouts. But it's a chore if it could be done in a few mouse clicks...


So, anyone have any tips on how to use this 'LAS' for above purpose if it's even possible. Or have any other way of being able to freeze certain layers in certain (not all) viewports on a layout.
For something like this to be possible a viewport should probably have some unique ID, but i see no option for that in the properties of a viewport.

Edited by OMEGA-ThundeR
Link to comment
Share on other sites

I think your correct Las is more a global thing not at Viewport level, the command VPLAYER is used at the viewport level and can freeze/thaw a layer in the viewports. The only thing I see as a problem is that each layout may need 3 viewports, as you can get a viewport by code. In your case you will have 4 viewports returned as paperspace is included, you can say jump into Viewport 2 and run Vplayer. So the correct viewport can be found automatically in every layout. Using say layout C to make layouts would be that way to go as have title block and 3 viewports all set up.

 

(setq ssv (ssget "X" '((0 . "VIEWPORT")(cons 410 (getvar 'ctab)))))
(sslength ssv)

; should return 4 for 3 viewports

So can select viewport. Now where is that code. I remember something about Vla-item getting viewport.

 

Post a sample dwg with multi layouts and describe layers to be frozen or left on.

 

 

Edited by BIGAL
Link to comment
Share on other sites

  • 1 month later...

Assuming those layouts were from the same template the CVPORT (System Variable) should return the same number on every layout when the "overall view" viewport is active. A simple script to set CVPORT to that value on each layout and vp freeze that layer should work. Lisp could be faster.

Don't have access to AutoCAD at this time but if it's true posting the value of CVPORT in that viewport and the layer name might help get you an answer.

 

Of course setting that layer current then on each tab doubleclick inside to activate that viewport then click the icon in the VP Freeze column for the current layer in the Layer Properties Manager shouldn't take more that 4 minutes for 25 layouts. Many users keep that Layers drop-down in their Quick Access Toolbar so it's always accessible.

Link to comment
Share on other sites

Have you looked at the Action Recorder? You could record yourself clicking in the viewport, turning off the correct layer, and returning to paper space. It's not much, but it would save a lot of repetition. Similarly, you could write a macro. I'm assuming each viewport is in the same location so that you could click on the same location on each sheet. If that's not true, go with Tombu's scheme. Or you could write a function.

Link to comment
Share on other sites

Something like go into model space, you hopefully get which viewport is active, then just pick an object, making a list of layers, for me dont use names just select !. A more global approach. Then using the list go through every layout and reset the layers for correct viewport. I did something in some code to work out which viewport you are in will find.

 

I think it was select viewport 1st to work out which one as suggested, 1-4.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...