Toggle Viewport lock

Discussion in 'AutoCAD' started by Pierre Marcotte, Aug 28, 2003.

  1. Hi y'alls...
    I wrote this simple thing (see below) in order to automate the locking of
    all viewports in a drawing. I now need to be able to toggle them on and off
    with the same button. Is there a lisp way to check if a viewport is locked
    or not ? I looked in the DXF reference but found nothing suitable.

    Thanx a bunch

    Pierre

    (DEFUN c:mvlock (/ mvss)
    (setvar "cmdecho" 0)
    ;; Gets all VIEWPORT entities
    (SETQ mvss (SSGET "X" '((0 . "VIEWPORT"))))
    ;; Locks them
    (COMMAND "_.vports" "L" "ON" mvss "")
    (PRINC)
    ) ;_ end DEFUN
     
    Pierre Marcotte, Aug 28, 2003
    #1
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.