Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
imtaha
Posts: 53
Registered: ‎03-25-2009
Message 1 of 4 (333 Views)

Batch Block insertion

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

Thanks
Mentor
southie
Posts: 291
Registered: ‎03-15-2007
Message 2 of 4 (333 Views)

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)
);foreach
(setq plist nil)



HTH
Southie
New Member
bitdraughty
Posts: 1
Registered: ‎08-30-2014
Message 3 of 4 (43 Views)

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 

 

 

Mentor
devitg
Posts: 1,705
Registered: ‎03-14-2004
Message 4 of 4 (31 Views)

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
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!