Visual LISP, AutoLISP and General Customization

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

Batch Block insertion

280 Views, 1 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 2 (280 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community