(getvar"screensize") not updated after (vla-put-Width)

Discussion in 'AutoCAD' started by James Chung, Jan 13, 2004.

  1. James Chung

    James Chung Guest

    I found that (getvar"screensize") is not updated within a lisp function after (vla-put-Width).

    (defun screensize_not_updated(/ *acad* *adoc*)
    (vl-load-com)
    (setq *acad*(vlax-get-acad-object))
    (setq *adoc*(vla-get-ActiveDocument *acad*))
    (mapcar'princ(list"\nDocument size: "(list(vla-get-Width *adoc*)(vla-get-Height *adoc*))))
    (mapcar'princ(list"\nScreen size: "(getvar"screensize"))) (vla-put-WindowState *adoc* acNorm)
    (vla-put-Width *adoc*(vlax-make-variant 400.0 vlax-vbDouble))
    (vla-put-Height *adoc*(vlax-make-variant 300.0 vlax-vbDouble))
    (mapcar'princ(list"\n\nNow changed to\nDocument size: "(list(vla-get-Width *adoc*)(vla-get-Height *adoc*))))
    (mapcar'princ(list"\nScreen size: "(getvar"screensize")))
    (textpage)
    (vlax-release-object *adoc*)
    (vlax-release-object *acad*)
    (princ)
    )

    Command: (screensize_not_updated)

    Document size: (843 607)
    Screen size: (831.0 561.0)

    Now changed to
    Document size: (400 300)
    Screen size: (831.0 561.0) => here not updated.

    Command: (getvar"screensize")
    (388.0 254.0)) => updated just now

    How to update (getvar"screensize") in a same lisp function?
    Any comments will be appreciated.
     
    James Chung, Jan 13, 2004
    #1
  2. What happens if you perform an Update on the Application object?

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | I found that (getvar"screensize") is not updated within a lisp function
    after (vla-put-Width).
    |
    | (defun screensize_not_updated(/ *acad* *adoc*)
    | (vl-load-com)
    | (setq *acad*(vlax-get-acad-object))
    | (setq *adoc*(vla-get-ActiveDocument *acad*))
    | (mapcar'princ(list"\nDocument size: "(list(vla-get-Width
    *adoc*)(vla-get-Height *adoc*))))
    | (mapcar'princ(list"\nScreen size: "(getvar"screensize")))
    (vla-put-WindowState *adoc* acNorm)
    | (vla-put-Width *adoc*(vlax-make-variant 400.0 vlax-vbDouble))
    | (vla-put-Height *adoc*(vlax-make-variant 300.0 vlax-vbDouble))
    | (mapcar'princ(list"\n\nNow changed to\nDocument size:
    "(list(vla-get-Width *adoc*)(vla-get-Height *adoc*))))
    | (mapcar'princ(list"\nScreen size: "(getvar"screensize")))
    | (textpage)
    | (vlax-release-object *adoc*)
    | (vlax-release-object *acad*)
    | (princ)
    | )
    |
    | Command: (screensize_not_updated)
    |
    | Document size: (843 607)
    | Screen size: (831.0 561.0)
    |
    | Now changed to
    | Document size: (400 300)
    | Screen size: (831.0 561.0) => here not updated.
    |
    | Command: (getvar"screensize")
    | (388.0 254.0)) => updated just now
    |
    | How to update (getvar"screensize") in a same lisp function?
    | Any comments will be appreciated.
    |
    |
     
    R. Robert Bell, Jan 13, 2004
    #2
  3. James Chung

    James Chung Guest

    I willing to save a wmf file with adjusted document size and updated screen size.
     
    James Chung, Jan 13, 2004
    #3
  4. James Chung

    Doug Broad Guest

    Thanks James. Interesting.


    *adoc*))))
     
    Doug Broad, Jan 13, 2004
    #4
  5. Yeah, I can't find a way to update it (in 10 minutes, anyway).

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | Thanks James. Interesting.
    |
    |
    | > I found that (getvar"screensize") is not updated within a lisp function
    after
    | (vla-put-Width).
    | >
    | > (defun screensize_not_updated(/ *acad* *adoc*)
    | > (vl-load-com)
    | > (setq *acad*(vlax-get-acad-object))
    | > (setq *adoc*(vla-get-ActiveDocument *acad*))
    | > (mapcar'princ(list"\nDocument size: "(list(vla-get-Width
    *adoc*)(vla-get-Height
    | *adoc*))))
    |
    |
     
    R. Robert Bell, Jan 13, 2004
    #5
  6. James Chung

    James Chung Guest

    Hopefully, you can find a way.
     
    James Chung, Jan 14, 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.