Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
mhlr
Posts: 64
Registered: ‎03-18-2008
Message 11 of 14 (131 Views)

Re: Tile Vertical Multiple Dwgs.

06-07-2012 10:15 AM in reply to: _Tharwat

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.

Valued Contributor
mhlr
Posts: 64
Registered: ‎03-18-2008
Message 12 of 14 (130 Views)

Re: Tile Vertical Multiple Dwgs.

06-07-2012 10:17 AM in reply to: _Tharwat

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.

Distinguished Mentor
_Tharwat
Posts: 576
Registered: ‎07-02-2010
Message 13 of 14 (124 Views)

Re: Tile Vertical Multiple Dwgs.

06-07-2012 12:11 PM in reply to: mhlr

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 .

 

____________________________________________________
Get learn and learn and practice , to become experienced guy .
Distinguished Mentor
andrewpuller3811
Posts: 762
Registered: ‎07-30-2008
Message 14 of 14 (107 Views)

Re: Tile Vertical Multiple Dwgs.

06-10-2012 05:13 AM in reply to: _Tharwat

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.

 

If this fixed your issue, click on "Accept as Solution"

Andrew Puller
Maitland, NSW, Australia
Windows 7 Enterprise 64bit
Intel core i7 2600 @ 3.40 GHz with 16GB Ram
Civil 3d 2013 64bit

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community