Lisp to turn off all vp frozen layers within a viewport

Lisp to turn off all vp frozen layers within a viewport

Ryan207
Enthusiast Enthusiast
1,920 Views
4 Replies
Message 1 of 5

Lisp to turn off all vp frozen layers within a viewport

Ryan207
Enthusiast
Enthusiast

Hi,

Does anyone have a lisp that will turn off all "VP Freeze" layers while within the current viewport?

 

Thanks!

0 Likes
Accepted solutions (1)
1,921 Views
4 Replies
Replies (4)
Message 2 of 5

cadffm
Consultant
Consultant
?
You really want a lisp that turn off Layers (global in your dwg) which VPfreeze=yes in current Viewport?

Sebastian

0 Likes
Message 3 of 5

Ryan207
Enthusiast
Enthusiast

Yes, that's what I'm looking for.  

I want to be able to create a layout, manage my layers in a viewport with VP Freeze.  If i have to do any additional design or adjustments I want model space to reflect the same layers that are available in my paper space.  

0 Likes
Message 4 of 5

cadffm
Consultant
Consultant
Accepted solution

A little bit crazy, but ok (why you work with VPfreeze and not Freeze?)

 

VPMAX VPMIN  also does not provide an acceptable workflow?

 

Note: All Layers which VPfreezed in one VP, set to OFF (="global" = in all spaces an viewports)

- is NOT the same view in Modelspace  (if there are nested objects on that layers, in Blocks or XRefs)

Remember the difference On/Off - Freeze/Thaw for nested objects ]

And if you have more Vports, you change the displayed view also there.

===========

 

;;; All VPfreezed Layer in current VP set OFF
(defun c:CurVPFRlaySetOFF (/ tmp)
  (if (and
    (zerop(getvar 'tilemode))
    (< 1  (getvar 'cvport))
      )
      (foreach VP (mapcar 'cadr (ssnamex (ssget "_X" (list '(0 . "VIEWPORT")(cons 410 (getvar 'ctab))))))
    (if (= (getvar 'cvport) (cdr(assoc 69 (entget VP))))
        (foreach lay (vl-remove-if-not '(lambda(dp)(= 331 (car dp))) (entget vp))
          (and
        (setq lay (entget (cdr lay)))
        (<= 0 (cdr(assoc 62 lay)))
        (princ (strcat "\nLayerOFF: " (cdr(assoc 2 lay))))
            (entmod (subst (cons 62 (* -1 (abs(cdr(assoc 62 lay))))) (assoc 62 lay) lay))
            ; simple Option to VPthaw this Layer in ALL VPorts; (command "_.VPLAYER" "_thaw" (cdr(assoc 2 lay)) "_all" "")
          )
        )
    )
      )
      (princ "\nCurVPFRlaySetOFF only available in floating modelspace / inside a paperspace viewport")
  )
 (princ)
)

 

Sebastian

0 Likes
Message 5 of 5

Ryan207
Enthusiast
Enthusiast
That's what I was looking for. Thanks!! Works Great!
I work with VP Freeze because we use multiple tabs (Paperspace) per drawing.

0 Likes