Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Valued Contributor
53 Posts
0 Kudos
Registered: ‎03-25-2009
Post 1 of 4

Batch Block insertion

334 Views, 3 Replies
03-25-2009 09:06 AM
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.

291 Posts
2 Kudos
Registered: ‎03-15-2007
Post 2 of 4

Re: Batch Block insertion

03-25-2009 10:19 AM 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)
(setq plist nil)

New Member
1 Posts
0 Kudos
Registered: ‎08-30-2014
Post 3 of 4

Re: Batch Block insertion

08-30-2014 09:56 AM 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 



1,705 Posts
19 Kudos
Registered: ‎03-14-2004
Post 4 of 4

Re: Batch Block insertion

08-31-2014 02:01 PM 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.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!