Does anyone in the group know how to do this?:
I have multiple dwgs. opened but minimized so that only their small windows are line up down at the bottom of Autocad. I want to know if there is a way to call them all up to full screen, tiled vertically, at the same time with one command.
Thanks in advance.
M.
The command is already existed in the menu Window -> Tile Vertically .
When I issue that command it DOES NOT bring all of the minimized dwgs. back up to full screen, is there a variable or setting somewhere to make that happen??
Use this code to maximize all drawings then use the command Tile Vertically .
(vlax-for x (vla-get-documents (vlax-get-acad-object))
(vla-put-windowstate x Acmax)
)
Forgive me in advance!! I know your trying to help!! Could you tell me how to utilize this code? I know nothing about Autolisp or any programming language!! I know what I want to do but don't know how to make it happen!!
Thank you
Look into vla-put-windowstate
WindowState
acWindowState enum; read-write
acMin
The window is minimized.
acMax
The window is maximized.
acNorm
The window is normal (neither minimized nor maximized).
[I'm too slow......];<-----
It is Ok ,
1- Open Visual lisp editor by typing vlide then a new file and save the following code in the new file to a specific location and then go back to Autocad and type in the command line AP and a dialog box would appear and after that select the file that you have just created and press load .
2- finally , type test to see the result .
(defun c:Test nil (vl-load-com) (vlax-for x (vla-get-documents (vlax-get-acad-object)) (vla-put-windowstate x Acmax) ) (princ) )
Perfect. thanks so much for the help! I will try this on my lunch break & get back. I was just handed a deadline that has little time to complete from my boss!!
I'm sorry _Tharwat,
I loaded the code fine, AP says it loaded fine. I open multiple dwgs., minimize them, open one in the full editor & type "Test".
The Autcad screen flashes but nothing happens. I enter the command for Tile Vertical & the same dwgs. are still minimized. Does this work fine on your machine??
thanks again,
M.
@mhlr wrote:I'm sorry _Tharwat,
I loaded the code fine, AP says it loaded fine. I open multiple dwgs., minimize them, open one in the full editor & type "Test".
The Autcad screen flashes but nothing happens. I enter the command for Tile Vertical & the same dwgs. are still minimized. Does this work fine on your machine??
thanks again,
M.
That's really strange , it works as expected here .
You may have an old version of Autocad ?
I have version 2012. This isn't the first time something won't work in my program but will on another! Thanks very much for your help. I've tried changing the command, moving the .lsp file to another directory etc. And "AP" loads it fine but when I type the command in the command prompt says "Unknown Command".
Thanks again.
No matter what I change the command to, it doesn't recognize it but the routine loads fine in Appload. Thanks for your help anyway.
@mhlr wrote:I have version 2012. This isn't the first time something won't work in my program but will on another! Thanks very much for your help. I've tried changing the command, moving the .lsp file to another directory etc. And "AP" loads it fine but when I type the command in the command prompt says "Unknown Command".
Thanks again.
It is working fine here on the other computer , I hope that someone else would test the code too .
Using the code posted
(defun c:Test nil (vl-load-com) (vlax-for x (vla-get-documents (vlax-get-acad-object)) (vla-put-windowstate x Acmax) ) (princ) )
I get the same result as mhlr. All that happens is the drawings are maximized.
I only know basic lisp, but it doesn't look like there is anything in the code that looks like it will put the windows in split view, only maximise the drawings.
But after a little research in the AutoLISP Reference, I modified the above code to this which works. I thought it didn't at first, as I had six windows and that tiled in two rows, but that is the normal behaviour of the tile vertical command.
(defun c:Test nil (vl-load-com) (vlax-for x (vla-get-documents (vlax-get-acad-object)) (vla-put-windowstate x acNorm) ) (command "syswindows" "vert") (princ) )
Instead of putting the window state to maximized, it puts the window state to acNorm, which is basically the same as restoring each window, then call the command syswindows and call for vertical tiling.
Can't find what you're looking for? Ask the community or share your knowledge.