Author Topic: VP Freezing all layers that are turned off  (Read 246 times)

0 Members and 1 Guest are viewing this topic.

Bmossman

  • Mosquito
  • Posts: 6
VP Freezing all layers that are turned off
« on: October 04, 2017, 09:27:28 am »
I am trying to VPFREEZE all layers that are currently turned off in the active viewport only. Does anyone have a routine that accomplishes this?



Master_Shake

  • Swamp Rat
  • Posts: 1289
Re: VP Freezing all layers that are turned off
« Reply #1 on: October 06, 2017, 02:14:44 pm »
You'll need a few steps.

1) Create a list of layers which are turned off
2) Process each layer by freezing it
3) Increase productivity
4) ...
5) ...
6) Profit!


Bmossman

  • Mosquito
  • Posts: 6
Re: VP Freezing all layers that are turned off
« Reply #3 on: October 10, 2017, 01:29:04 pm »
Thank you for the responses. Is it possible to issue the VPLAYER command that will VPFREEZE in lieu of freezing? Sorry this all looks Greek to me. I tried changing the command to VPLAYER, but apparently I'm doing something wrong.

Code: [Select]
(defun c:fo (/ l dxf code list)
(defun dxf (code list)
(cdr (assoc code list))
);defun
(setq l (tblnext "layer" T))
(command "VPLAYER")
(while l
(cond ((< (dxf 62 l) 0) (command "f" (dxf 2 l))))
(setq l (tblnext "layer"))
);while
(command "")
(setq l ())
(cond ((not (null gc)) (gc)))
)

Seems to be erroring out obtaining the layer names that are turned off:

Command: FO
VPLAYER Enter an option [?/Color/Ltype/LWeight/TRansparency/Freeze/Thaw/Reset/Newfrz/Vpvisdflt]: f
Enter layer name(s) to freeze or <specify layers by object selection>: S-ANNOT-P-TXT
Specify viewport(s) [All/Select/Current/eXcept current] <Current>: f
Invalid option keyword.
; error: Function cancelled

Specify viewport(s) [All/Select/Current/eXcept current] <Current>:
Enter an option [?/Color/Ltype/LWeight/TRansparency/Freeze/Thaw/Reset/Newfrz/Vpvisdflt]:

Bmossman

  • Mosquito
  • Posts: 6
Re: VP Freezing all layers that are turned off
« Reply #4 on: October 11, 2017, 12:10:31 pm »
Figured it out. I had to add "c" to select the "current" viewport under line 8

Code: [Select]
(defun c:fo (/ l dxf code list)
(defun dxf (code list)
(cdr (assoc code list))
);defun
(setq l (tblnext "layer" T))
(command "VPLAYER")
(while l
(cond ((< (dxf 62 l) 0) (command "f" (dxf 2 l) "c")))
(setq l (tblnext "layer"))
);while
(command "")
(setq l ())
(cond ((not (null gc)) (gc)))
)