ripuz Posted February 19, 2013 Share Posted February 19, 2013 Hello! I would like a script file that could switch between all open drawings and run some random code. The problem is that I can´t find a way to switch drawing and still go on with the script. This scriptfile will switch to the first open drawing but it will not execute the line command in that drawing. The line command will be executed when I go back to the drawing where the script were executed. (vla-activate (vla-item (vla-get-Documents (vlax-get-acad-object)) 0)) line This scriptfile will do what it´s supposed to do. It will start a new drawing and draw a line from 0,0 to 100,100. filedia 0 new Q:\PROG\KDB\MC\Templates\Swe\ELCD_IEC1082.dwt line 0,0 100,100 filedia 1 Is there another way to switch active drawing? Maybe there is a command to switch instaid of that lisp? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
JGA Posted February 27, 2013 Share Posted February 27, 2013 The script is running in the first drawing, but won't jump over to the second one. You need to create the new file, then run the script with it. If you have the full version, you can apply the script to any selected drawings via ScriptPro. If you have LT, I think you can do it via a windows batch file & autocad startup options, but I don't know the code to do this, sorry. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.