Jump to content

Switch between open drawings


ripuz

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...