Layout scale

Discussion in 'AutoCAD' started by Daniel Hargreaves, Nov 14, 2004.

  1. I'm trying to get the plotscale of a layout.

    I have tried
    (vla-get-standardscale (vla-get-activelayout (vla-get-activedocument
    (vlax-get-acad-object))))
    and it returns 16 if it is 1:1 if the scale is 1:2 it returns 17, 1/4"=1'-0"
    returns 8 and 1'-0"=1'-0" returns 15. I just don't seem to understand the
    values it is returning. Does anyone have a way to retrieve the plotscale of
    a layout? TIA.

    Daniel Hargreaves.
     
    Daniel Hargreaves, Nov 14, 2004
    #1
  2. Daniel,

    I got this some while back from this NG I think, but can't tell you now who
    actually posted it.

    ;; Q: How to determine the relative (paper/model space)
    ;; scale factor of the current model space viewport.
    ;;

    (defun xpfact ()
    (- (car (trans '(1 0 0) 2 3))
    (car (trans '(0 0 0) 2 3))
    )
    )


    Just enter (xpfact) at the command prompt whilst in an active VP for it to
    return the desired data.

    HTH
    Gordon Stephens
     
    Gordon Stephens, Nov 14, 2004
    #2
  3. I dug through the archives and I found the answer posted by Robert Bell on
    July 9, 2003

    (defun GetLayoutPlotScale (/ Numer Denom)
    (vl-Load-Com)
    (vla-GetCustomScale
    (vla-Get-ActiveLayout (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))
    'Numer
    'Denom)
    (/ Numer Denom))
     
    Daniel Hargreaves, Nov 14, 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.