Okay, so after some searching I figured out that I can get the "WindowState" of AutoCAD with this code:
(vlax-get-property (vlax-get-acad-object) "WindowState")
This returns "3" when the window is maximized, and "1" when the window is "restored down" to something less than maximum.
I assume it would return "0" if the window were minimized to the taskbar (but I haven't tested that yet).
[Correction: it appears that minimized is "2".]
This is fantastic, but how (where) do I find out what are all the possible values of "WindowState" and their meanings?
What I mostly need to know is what that value would be if AutoCAD were running in "hidden" mode.
Also (bonus question), somewhere I saw a list of "VL" functions that includes VLAX-GET-WINDOWSTATE. If such function exists, why doesn't this work?:
(vlax-get-WindowState (vlax-get-acad-object))
; error: no function definition: VLAX-GET-WINDOWSTATE
Solved! Go to Solution.
Solved by Gary_J_Orr. Go to Solution.
@dmfrazier wrote:Okay, so after some searching I figured out that I can get the "WindowState" of AutoCAD with this code:
(vlax-get-property (vlax-get-acad-object) "WindowState")
This returns "3" when the window is maximized, and "1" when the window is "restored down" to something less than maximum.
I assume it would return "0" if the window were minimized to the taskbar (but I haven't tested that yet).
[Correction: it appears that minimized is "2".]
This is fantastic, but how (where) do I find out what are all the possible values of "WindowState" and their meanings?
What I mostly need to know is what that value would be if AutoCAD were running in "hidden" mode.
Also (bonus question), somewhere I saw a list of "VL" functions that includes VLAX-GET-WINDOWSTATE. If such function exists, why doesn't this work?:
(vlax-get-WindowState (vlax-get-acad-object))
; error: no function definition: VLAX-GET-WINDOWSTATE
For your "bonus question" (note the lack of an "x" in the second of the following two calls)
(Vlax-get-property obj <propertyname>) was the precursor to (Vla-get-<proprety name> obj)
for your original question: look into the "Visible" property (or is visible a method???? hmmm...)
to answer that question do this:
(vlax-dump-object (vlax-get-acad-object) T)
(the last argument of "T") on the dump object call tells the return to include methods as well as just properties.
-Gary
"For your "bonus question" (note the lack of an "x"..."
Gotcha. Thanks. (I have to be more careful when I search through that list of functions... it might help if I understood what the "X" means.)
"...look into the "Visible" property (or is visible a method?)"
"Visible" is indeed a property, and it probably is the right property, so thanks for that. (I think I would have gotten there eventually - the "V" properties are a long way down the list...)
Help states that the Visible property can be either "true" or "false", and this appears to be supported by what this code returns when App window is "visible":
Command: (vla-get-Visible (vlax-get-acad-object))
:vlax-true
This is probably not going to impact my ability to use this info, but I am confused by the results of "dump-object", which includes this line:
; Visible = -1
I'm used to 1 or 0 representing "true" or "false". What would -1 indicate?
Thanks, again.
"this is true for and T/F property returned by dump object"
I think you meant ":vlax-true". "
Thanks, again.
I still wonder where one would go to find out what are all the possible values of a non-binary (true/false) application/document/object/(etc.) property (such as "WindowState") and their meanings.
hi,
just for clarification!:
(setq app (vlax-get-acad-object)) (setq doc (vla-get-activedocument app)) ;for current drawing window (vla-put-windowstate doc acmin) (vla-put-windowstate doc acmax) (vla-put-windowstate doc acnorm) ;for AutoCAD (vla-put-windowstate app acmin) (vla-put-windowstate app acmax) (vla-put-windowstate app acnorm)
Abbas
Thank you, Abbas.
It turns out what I really needed was the "Visible" property.
This code retrieves the info I need: (vla-get-Visible (vlax-get-acad-object))
Can't find what you're looking for? Ask the community or share your knowledge.