Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Batch Block insertion

3 REPLIES 3
Reply
Message 1 of 4
imtaha
576 Views, 3 Replies

Batch Block insertion

I have more than 100 dwgs, I need to insert a date block on each one of them, can any one help me with a batch file and a lisp routine for that.
Your help will be really apprecaited.

Thanks
3 REPLIES 3
Message 2 of 4
southie
in reply to: imtaha

Place all your drawings in a folder. Copy the code below to note pad and save in same folder as drawings. Place the block you want to insert in another folder. Launch one of the drawings the at command prompt type; (load "thenameoflispfile") see ;;********* below

(setq plist (vl-directory-files (getvar "dwgprefix") "*.dwg" 1))

(foreach ins1 plist
(setvar "lispinit" 0)
(command "open" ins1)
(command "insert" "c:\\bin\\ws001" "0,0" "" "" "");;***** "c:\\bin\\ws001" your block name with path
(command "save" ins1)
);foreach
(setq plist nil)



HTH
Southie
Message 3 of 4
bitdraughty
in reply to: southie

Hi Southie 

 

Im just trying to get your lisp to work but i am having a couple of problems, can you just explain what the stars are in the name please where you indicate to see below?

 

 

thank you 

 

 

Message 4 of 4
devitg
in reply to: bitdraughty

any thing after a ; it is a comment , it serve as a tip to help the user. In this case, it tell the user to put the whole path and file name, include its extension all further the ; do not do any to the lisp.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost