J
James Chung
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.
(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.