• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Visual LISP, AutoLISP and General Customization

    Reply
    Valued Contributor
    Posts: 53
    Registered: ‎03-25-2009

    Batch Block insertion

    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
    Please use plain text.
    Mentor
    Posts: 289
    Registered: ‎03-15-2007

    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
    Please use plain text.