Active Viewport

Discussion in 'AutoCAD' started by tsigwing, Jan 15, 2004.

  1. tsigwing

    tsigwing Guest

    How can I make the active viewport the actual page I am on? In other words if I use mview and create 3 viewports there are now 4 viewports. Can I make the 4th one the active viewport?
     
    tsigwing, Jan 15, 2004
    #1
  2. tsigwing

    tsigwing Guest

    What I am trying to do is to turn off all of the viewports because a lisp routine that runs is regening multiple times in every viewport and I would like to be able to do all of my stuff and then do 1 regenall for all viewports.
     
    tsigwing, Jan 15, 2004
    #2
  3. tsigwing

    Jeff Mishler Guest

    The "4th" viewport is the PaperSpace viewport and will always (at least
    in my somewhat limited checking) be the first one found. If you get a
    list of the viewport(s), ala the code I posted earlier today to another
    thread, you could make each one inactive quite easily.

    (defun test (/ *ACTIVELAYOUT* CSCALE LAYOUTBLK LAYVP)
    (setq *activelayout* (vla-get-activelayout
    (vla-get-activedocument
    (vlax-get-acad-object))
    ))
    (setq layoutblk (vla-get-block *activelayout*))
    (vlax-for item layoutblk
    (if (= (vla-get-objectname item) "AcDbViewport")
    (setq layvp (cons item layvp))
    )
    )
    (setq layvp (cdr (reverse layvp))); remove the PS view object
    (if layvp
    (progn
    (foreach x layvp
    (vla-display x :vlax-false);turn off vports
    )
    ;;do your other stuff here....
    (foreach x layvp
    (vla-display x :vlax-true);turn 'em back on
    )
    )
    )
    )

    Jeff

    words if I use mview and create 3 viewports there are now 4 viewports.
    Can I make the 4th one the active viewport?
     
    Jeff Mishler, Jan 15, 2004
    #3
  4. tsigwing

    tsigwing Guest

    I'll give that a try. Thanks,
     
    tsigwing, Jan 15, 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.