wanted LISP routine for switching layers

Frank Richarz

Usenet Archive
Joined
Jan 22, 2004
Messages
2
Reaction score
0
First off, I'm not even sure this is possible but I thought I'd ask.

I have a drawing sheet that contains both a ceiling plan and a floor plan. I have a script that will turn the correct layers on and off, but when I put both of these drawings on the same sheet I cannot turn one on without turning the layers off for the other one. I have had to go into the viewport and manually turn the layers on and off.

Is there a way to do this with a script, that I could go into the viewport and run the script, then go into the other viewport and run another script without effecting the first one.

Like I said, I'm not sure if its even possible.

Thanks for your help.
 
Yes, use vplayer inplace of layer.....and in vplayer there is no "off/on", only "freeze/thaw"

Jeff
 
Frank,
If the plans are separate xrefs you can put them on their own layer and vpfreeze that layer in the appropriate viewport.

If the two plans reside in the same drawing can modify your script to use the vplayer command instead of layer.

Mike Weaver
 
I've done a similar type thing. When I get the viewport showing what I want, I store the layer names for the layers that are turned on and not frozen in that viewport. I have a reactor that runs so that whenever you change layouts, it checks to see if the viewports have this information and if so it will do a vplayer freeze for all layers except that list that I stored. Works like a champ. Does add about a 5 second delay for really big drawings though when you change sheets.
 
"but when I put both of these drawings on the same sheet" If you mean you xref the "base drawing" into a plot sheet . . . forget vplayer. Here's what I do: Xref in "MyBasePlan.dwg" and rename it, in the xref manager, to "MyBasePlanRCP". Move it over in a clear space and then Xref it in again. Now you have 2 seperate xrefs with 2 seperate names, so the layers are appended as follows: "MyBasePlanRCP|A-Wall" and "MyBasePlan|A-Wall". See?

Your script will need to differentiate between the two - (strcat "MyBasePlanRCP|" lname) for the layer name.

I actually do this with a lisp routine that compares my standard layer states in a database drawing to layers in the active document - and I can filter xrefs.

jb
 

Latest threads

Back
Top