Layerstates and Vieport
Is there a way to assocaite a Saved Layerstate with a particular Viewports?
I have several saved Layerstates representing different plots I want to make of the same area in Layout mode.
It would be nice to be able to say "Layout 1" was associated with layer settings of "Layerstates-1" and so on.
regards
Richard
Comments
-
Hi Richard,
You probably know that, if only layer visibility is concerned, the 'vplayer' command (or the 'Curr. VP' column in the layer explorer) will do the job.
If changes to the linetype or color are needed, I don't know of an easy way to automate this - creating a small LISP that looks for a layerstate with a name that corresponds to the layout would be a breeze normally, but the 'layerstate' command is not a 'real' command, it just brings up the explorer with a certain page, and lacks a commadline version accessible to scripting (which IMO is a design flaw). It should be possible to read the necessary information from the respective dictionary and do everything in LISP, but that's a bit more complicated...
0 -
Yes do use that ('vplayer') Knut, but it occured to me when I was working on some surveys today that spanned 10 years and how nice it would be to actually be able to 'assign', 'tie', or similar a Layerstate to a Layout Viewport. It would be so much quicker as I create the various Layerstates as I go.
I am (in this case) only interested in layer visibility.
When working in modelspace this option is invaluable in my work and it's then I could see its value in viewports/ layouts in paperspace.
I then could have a '2001' Layerstate where only selected features of my 2011 survey and the ones from my 2001 survey are visible and so on for different years up to 2011.
Just seemed a good idea that would very quickly produce plots of successive years work without resort to 'vplayer'.0 -
Hi Richard,
I also used a combination of layerstates and viewports quite frequently, so I had a quick look... unfortunately, I can not even figure out how to read the layerstates in a drawing (ACAD_LAYERSTATES doesn't seem to be the right dictionary name), so I have to give up on this.
Anyway, the combination of global layerstates and vplayers is total crap, a sane solution would be to give each viewport its own, totally independent and comprehensive layer settings - but probably the sacred cow of acad compatibility will not let this happen.
0 -
@ Knut:
The dictionary you are looking for is called "ACAD_LAYERSTATES" but it is sort of tucked away:(vlax-dump-object (vla-item (vla-getextensiondictionary (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))) "ACAD_LAYERSTATES") 'T)
0 -
Thanks a lot , Roy
So I'll eventually have a look into all this vlax stuff, just hope it's already implemented in the Linux version...
0 -
Hello,
Torsten is looking at the possibility of adding the layersatates command to the program, as a real command. Lets hope this happens soon as I have a great need for this function myself, one of these needs is just as discussed here, to have a layer state associated with a paperspace tab.
Bruce
0 -
Good news, but a real command or the (layerstate-*) functions?
I bet the latter, but everything would be welcome, since the vla(x) stuff that Roy suggested isn't currently working on Linux...
0