Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Determine if a specific layer is VPthawed or VPfrozen?

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
scot-65
464 Views, 2 Replies

Determine if a specific layer is VPthawed or VPfrozen?

In paper space there are more than one floating view ports.

Each one has a unique set of VPLAYER freeze/thaw properties.

When a user double-clicks a view port to become active,

how can I determine if a specific layer in that view port is

either VPthawed or VPfrozen?

 

Actually, I will apply this to command VPMAX, but for now it makes no difference.

 

(This is a reactor exercise)

 

Thanks in advance.


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


2 REPLIES 2
Message 2 of 3
_gile
in reply to: scot-65

Hi,

 

You can find the frozen layers in the extended data of the viewport (registered application = "ACAD"), the 1003 group code stands for frozen layer names.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 3
scot-65
in reply to: scot-65

Gile provided somewhat a hint.

For those curious to learn this answer, here is the code:

 

;get entity name of desired layer and check if it exists [layer 0 is the example]
(if (setq a (tblobjname "LAYER" "0"))
 (progn
  ;one method to get viewport entity data and create a list of vpfrozen layer entities [DFX 331]
  (setq b nil)
  (foreach x (entget (ssname (ssget "X" (list
    (cons 0 "VIEWPORT")(cons 410 (getvar "CTAB"))(cons 69 (getvar "CVPORT")))) 0))
   (if (= (car x) 331) (setq b (cons (cdr x) b)) );if
  );foreach
  ;test if desired layer is in entity list
  (cond
   ( (not b) (alert "All VPLayers are thawed. ") )
   ( (member a b) (alert "VPLayer \"0\" is frozen.  ") )
   (T (alert "VPLayer \"0\" is thawed.  ") )
  );cond
  (setq a nil b nil)
 );progn
 (princ "\nLayer \"0\" does not exist. ")
);if
(princ)

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost