Viewport scales

Discussion in 'AutoCAD' started by Steve Jones, Jan 15, 2004.

  1. Steve Jones

    Steve Jones Guest

    Hello all,

    (setq *activelayout*
    (vla-get-activelayout
    (vla-get-activedocument (vlax-get-acad-object))
    )
    )

    Is there any way to check if *activelayout* (which is a paperspace layout)
    has viewports of differing scales?
    This is to be used with a reactor so I can't use (ssget)

    Any ideas?

    Steve
     
    Steve Jones, Jan 15, 2004
    #1
  2. Steve Jones

    Jeff Mishler Guest

    Something like this:

    (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
    (foreach x layvp
    (setq cscale (vla-get-customscale x))
    ;;do your other stuff here....
    )
    )
    )

    HTH,
    Jeff
     
    Jeff Mishler, Jan 15, 2004
    #2
  3. Steve Jones

    Steve Jones Guest

    Something EXACTLY like that.

    Cheers Jeff that's excellent, it was the (vla-get-block... that had me
    stumped

    Steve
     
    Steve Jones, Jan 15, 2004
    #3
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.