Author Topic: Mview question  (Read 2973 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Mview question
« on: June 23, 2004, 01:56:49 PM »
Is there a way to lock all mviews in the dwg tabs (several) in one dwg at one time?

rather than going into each layout tab and turning it on and off?

thanks
Civil3D 2020

ELOQUINTET

  • Guest
Mview question
« Reply #1 on: June 24, 2004, 02:19:30 PM »
this is about the best i can do. it doesn't work across layouts but it cuts out some steps. make a button and put this in

^C^CMV;L;ON;ALL


if you find a way lemme know

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Mview question
« Reply #2 on: June 24, 2004, 03:04:19 PM »
bingo... will do
Civil3D 2020

CADaver

  • Guest
Mview question
« Reply #3 on: June 24, 2004, 03:23:44 PM »
I think I got this from someone here:

Code: [Select]

;;MVIEW HIDE IN ALL LAYOUTS
(defun c:MVH(/ THISTAB VPLST)
  (setq THISTAB (getvar "CTAB"))
  (foreach LAYOUT (layoutlist)
    (setvar "CTAB" LAYOUT)
    (setq vplst (ssget "x" (list (cons 0 "viewport"))))
    (command "mview" "hide" "on" VPLST ""))
  (setvar "CTAB" THISTAB)
  (princ)
)

;;MVIEW LOCK IN ALL LAYOUTS
(defun c:MVLO(/ THISTAB VPLST)
  (setq THISTAB (getvar "CTAB"))
  (foreach LAYOUT (layoutlist)
    (setvar "CTAB" LAYOUT)
    (setq vplst (ssget "x" (list (cons 0 "viewport"))))
    (command "mview" "LOCK" "on" VPLST ""))
  (setvar "CTAB" THISTAB)
  (princ)
)

;;MVIEW UNLOCK IN ALL LAYOUTS
(defun c:MVU(/ THISTAB VPLST)
  (setq THISTAB (getvar "CTAB"))
  (foreach LAYOUT (layoutlist)
    (setvar "CTAB" LAYOUT)
    (setq vplst (ssget "x" (list (cons 0 "viewport"))))
    (command "mview" "LOCK" "off" VPLST ""))
  (setvar "CTAB" THISTAB)
  (princ)
)

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Mview question
« Reply #4 on: June 24, 2004, 03:36:20 PM »
Here's a couple that affect ALL PS viewports without switching Tabs while doing it. Much faster, especially with lots of tabs.

Code: [Select]

(defun c:lockallVP ()
  (vl-load-com)
  (ssget "x" '((0 . "VIEWPORT")))
  (vlax-for item (vla-get-activeselectionset
  (vla-get-activedocument
    (vlax-get-acad-object)))
    (vla-put-displaylocked item :vlax-true)
    )
  )
(defun c:unlockallVP ()
  (vl-load-com)
  (ssget "x" '((0 . "VIEWPORT")))
  (vlax-for item (vla-get-activeselectionset
  (vla-get-activedocument
    (vlax-get-acad-object)))
    (vla-put-displaylocked item :vlax-false)
    )
  )


Jeff

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Mview question
« Reply #5 on: June 24, 2004, 03:37:17 PM »
WONDERFUL!  yes wonderful!   thank you:)
Civil3D 2020