PDA

View Full Version : getting a viewport to open in a given layerstate


Peter Hunt
28-02-2005, 10:56 AM
I have set up various layer states. How do I write code to specific each viewport to open in a particular layerstate? There are several viewports on each layout?

A bit of background. I'm asking how do to this because having set up various viewports as I want them by switching off layers I don't want in the Current VP Freeze box ... when I introduce new layers into the drawing I keep having to go back to the earlier viewports and switch the new layers of in the current VP freeze box, which is a pain!

Perhaps I'm missing something simple? It's as if I need a 'old viewport freeze' box when setting up a new layer.

Any clues appreciated!

hendie
28-02-2005, 11:16 AM
when you create new layers why don't you use the "Freeze in existing viewports" option ?

Peter Hunt
28-02-2005, 11:35 AM
How do I do that? I've spent weeks trying to!

hendie
28-02-2005, 01:16 PM
I haven't really messed with it much but from what I can gather, the layer state is attached to the viewport as xdata.
So you would need to query the viewport, get the layers current status from there and modify as required

Peter Hunt
28-02-2005, 02:23 PM
I've just found the vplayer command. The newfrz option allows you to create a new layer frozen in all (including existing) viewports. Then only have to thaw the layer where it is required in a viewport, rather than having to switch it off in many previously created viewports.

Thanks for your help - got there in the end, and no code in sight!

peter

ps perhaps my question should be in AutoCad for dummies forum!