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

  • Thread starter Thread starter James Chung
  • Start date Start date
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.
 
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.
|
|
 
I willing to save a wmf file with adjusted document size and updated screen size.
 
Thanks James. Interesting.


James Chung said:
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*))))
 
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*))))
|
|
 
Back
Top