How do I get the current display coords?

Discussion in 'AutoCAD' started by Tom Craft, Jan 22, 2004.

  1. Tom Craft

    Tom Craft Guest

    A routine of mine creates a block and inserts it into the drawing. The
    block is intended to appear as a part of the operating system and is
    erased and deleted at the completion of the routine. I would like the
    block size as displayed on screen to be pretty much consistent, created
    at a size roughly equal to a % of the screen display, regardless of the
    modelspace area displayed.
    How can I retrieve the modelspace coordinates of the current display? I
    tried the activeviewport.height property, but it does not act as
    required. An API call?

    Thanks

    Tom Craft
     
    Tom Craft, Jan 22, 2004
    #1
  2. How about the SCREENSIZE sys. var?
     
    Bobby C. Jones, Jan 22, 2004
    #2
  3. Tom Craft

    Tom Craft Guest

    Bobby,
    Thanks for the reply. Sorry took so long to reply, was on vacation.
    The SCREENSIZE sys var returns the dimesions of the screen in pixels.As I
    understand the help file (which says very little about this variable), the
    screen size reported is dependent on the monitor and Windows display settings
    and will not change as the drawing is zoomed in or out.
    I am lookling for the dimension of the modelspace drawing that is displayed.

    Tom
     
    Tom Craft, Feb 2, 2004
    #3
  4. Tom Craft

    Jeff Mishler Guest

    Tom,

    Here's what I use to show an "x" at the starting pont of a pline in a lisp.
    The "x" is always the same size as seen by the user, ie relative to the
    current display. I think you could adapt this to use as the scale for the
    block.

    (setq start (vlax-curve-getstartpoint objpoly)
    leglen (* 0.03 (getvar "viewsize"))
    )
    (grdraw (polar start (angtof "135" 1) leglen)
    (polar start (angtof "315" 1) leglen)
    7)
    (grdraw (polar start (angtof "45" 1) leglen)
    (polar start (angtof "225" 1) leglen)
    7)

    HTH,
    Jeff
     
    Jeff Mishler, Feb 2, 2004
    #4
  5. Not exactly . The name of the sysvar (and the obsolete
    documentation) is an artifact of AutoCAD's DOS heritage,
    where the graphics window/viewport was the screen, not
    a window.

    The SCREENSIZE system variable returns the size of the
    active viewport, in pixels.

    If you want the size of a viewport in model space
    drawing units, you can divide the Y component of
    the screensize by the viewsize sysvar, and determine
    the size of a pixel, and use that to calculate the
    other dimension in drawing units.
     
    Tony Tanzillo, Feb 2, 2004
    #5
  6. Tom Craft

    Tom Craft Guest

    Thanks, Tony

     
    Tom Craft, Feb 3, 2004
    #6
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.