Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
*Expert Elite*
scot-65
Posts: 2,128
Registered: ‎12-11-2003
Message 1 of 3 (130 Views)
Accepted Solution

Determine if a specific layer is VPthawed or VPfrozen?

130 Views, 2 Replies
05-15-2014 03:20 PM

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
Dyslexia is a permanent physical disability that cannot be seen.
*Expert Elite*
_gile
Posts: 2,077
Registered: ‎04-29-2006
Message 2 of 3 (126 Views)

Re : Determine if a specific layer is VPthawed or VPfrozen?

05-15-2014 03:35 PM 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
*Expert Elite*
scot-65
Posts: 2,128
Registered: ‎12-11-2003
Message 3 of 3 (66 Views)

Re: Determine if a specific layer is VPthawed or VPfrozen?

05-21-2014 03:20 PM 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
Dyslexia is a permanent physical disability that cannot be seen.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community