Jump to content

Recommended Posts

Posted

Hi :D

 

I have a very repetative task ahead of me and I want to use a script if possible to make my day slightly more bareable.

I need to 'paste' 8 blocks into 250+ drawings with co-ordinates 0,0,0 and I dont want to go through all the drawings individually and type: CTR, C, 0,0,0

can anyone assist me in creating a script that will copy these 8 blocks from one drawing with a base-point of 0,0,0 and paste it to many drawings and finally qsave and close? (will be running the script using ScriptPro) :cry:

 

Please help!

Luke

Posted

You should export those blocks from source drawing using WBLOCK command for further access - save them on disk as separate files.

If the target drawings already exist, then create a list with their names using a BAT file and this code:

DIR /b *.DWG > drawings.txt

Next step will be to create the script - I suggest you to use Excel for that. Don't forget to save it as plain text using SCR extension.

If the paths of blocks to be inserted and/or target drawings contains spaces, should surround them by quotation marks.

Posted

Thanks Mircea! you have been very helpfull I will try out this method now. Thanks! :D

Posted

I wrote this post on creating AutoCAD scripts for CAD-NOtes.com:

http://cad-notes.com/2012/03/learn-how-to-write-command-scripts-for-autocad-and-automate-your-plotting/

 

It uses plotting as an example, but there is no reason why you could apply it to block inserts instead.

 

The process is:

-Turn off the dialogues

-Work out how to do what you need to do using the command line only

-Copy and paste the commands into a note pad file

-Edit out the junk

 

You could make the whole thing a step easier by putting all eight blocks inside one block and exploding it on entry.

 

Don't forget to include purge and audit as part of your script!

 

Paul

Posted

Some more shorts cuts make your list like Msasu above but open in WORD you can create a script in a few seconds if you use "Replace"

 

The ^p is the end of line so you replace ^p with "insert myblock 0,0 1 1 0 explode last close Y^p" instantly your script is half done

 

Again use ^p but put a "Open" in the front of each line press enter top line, then replace ^p with ^popen once space after n

 

make sure you save as a txt file with .scr

Posted

Thats really helpful and I think I should be able to create the script from all the info you guys have given me. I will post the script on here once it's finishd incase anyone else finds it useful. Thank you very much!!! :D

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...