Visual LISP, AutoLISP and General Customization
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Batch Block insertion
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
210 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
Your help will be really apprecaited.
Thanks
Re: Batch Block insertion
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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
(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

