Viewport Layer Freeze Toggle Button

Discussion in 'AutoCAD' started by b_veasey2002, Feb 17, 2004.

  1. b_veasey2002

    b_veasey2002 Guest

    Can someone supply me with a button macro for toggling a view port layer from frozen to unfrozen & vice-versa?

    My viewports are all on layer "VPorts".
     
    b_veasey2002, Feb 17, 2004
    #1
  2. b_veasey2002

    CAB2k Guest

    How about a LISP?

    Button:
    ^C^Cvp_layer_toggle

    Lisp:
    (defun c:vp_layer_toggle (/ lname entlst toggle)
    (setq lname "Vports")
    (if (tblsearch "layer" lname)
    (progn
    (setq toggle
    (if
    (and (= (type lname) 'str)
    (setq entlst (tblsearch "layer" lname))
    (= 1 (logand 1 (cdr (assoc 70 entlst))))
    )
    "T"
    "F"
    ) ; endif
    )
    (if (and (= toggle "F")
    (= (strcase (getvar "clayer")) (strcase lname))
    )
    (setvar "clayer" "0")
    )
    (command ".-layer" toggle lname "")
    )
    (prompt (strcat "\nError! Layer " lname " not found."))
    )
    (princ)
    ) ; end defun
     
    CAB2k, Feb 17, 2004
    #2
  3. b_veasey2002

    b_veasey2002 Guest

    EXACTLY what I was looking for, works a treat! Tq
     
    b_veasey2002, Feb 18, 2004
    #3
  4. b_veasey2002

    CAB2k Guest

    CAB2k, Feb 18, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.