Author Topic: Viewports Display Off  (Read 3129 times)

0 Members and 1 Guest are viewing this topic.

DanB

  • Bull Frog
  • Posts: 367
Viewports Display Off
« on: March 15, 2007, 12:40:15 PM »
Is it possible to have ALL Layout Viewports in a drawing turned off without going through each layout tab?

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Viewports Display Off
« Reply #1 on: March 15, 2007, 12:43:10 PM »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

DanB

  • Bull Frog
  • Posts: 367
Re: Viewports Display Off
« Reply #2 on: March 15, 2007, 12:56:16 PM »
Thanks for the fast reply, it also lead me to the answer to my follow up question on locking them as well.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Viewports Display Off
« Reply #3 on: March 15, 2007, 01:07:01 PM »
Here is a version of lock\unlock viewports:

Code: [Select]
;;UNLOCK OR LOCK ALL VPORTS

(defun c:vplockall (/ X lck prmpt ent clr clr2 obj)
  (vl-load-com)
  (initget 0 "Lock Unlock")
  (if (not *default*)
    (setq *default* "Lock")
  )
  (setq
    X (cond
((getkword
   (strcat
     "\n (L)ock or (U)nlock all viewports?  <<Hit Enter for "
     *default*
     ">>: "
   )
)
)
(*default*)
      )
  )
  (setq *default* X)
  (cond ((= X "Lock")
(setq lck   :vlax-true
       prmpt "locked..."
       clr   5
       clr2  acBlue
)
)
((= X "Unlock")
(setq lck   :vlax-false
       prmpt "unlocked..."
       clr   1
       clr2  acRed
)
)
  )
  (vlax-for lay (vla-get-layouts
  (vla-get-activedocument
    (vlax-get-acad-object)
  )
)
    (if (eq :vlax-false (vla-get-modeltype lay))
      (vlax-for ent (vla-get-block lay)
(if (= (vla-get-objectname ent) "AcDbViewport")
  (progn
    (vla-put-displaylocked ent lck)
    (vla-put-color ent clr)
    (if (setq
  obj (assoc 340 (entget (vlax-vla-object->ename ent)))
)
      (vla-put-color (vlax-ename->vla-object (cdr obj)) clr2)
    )
  )
)
      )
    )
  )
  (princ (strcat "\n All viewports have been " prmpt))
  (princ)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Viewports Display Off
« Reply #4 on: March 15, 2007, 02:35:04 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Viewports Display Off
« Reply #5 on: March 15, 2007, 02:40:05 PM »
You might want to read this.  It has some good information on viewports, and selecting all of them without stepping through each layout.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.