Lsp to copy old title blocks to current dwg folder

Discussion in 'AutoCAD' started by DB, Aug 22, 2004.

  1. DB

    DB Guest

    Hi all,

    I am after a lisp routine to copy some title block files
    that into the root directory of a job. These title blocks
    are xrefed into the drawings and I need to copy them under
    the actual drawing directory as we are replacing our titles
    but still need to use the old ones for previous jobs.

    I know there is a setvar for dwg prefix but I don't write lisp so can't
    get much further than that.

    So it needs to copy a few dwg files from a network path

    F:\Autocad\acad_2004\support\cams\old_titles\title1 and title2.dwg

    To the directory for the current drawing defined in setvar dwg prefix.

    Can anyone help or point me to a better way to do this.

    Regards
    DB
     
    DB, Aug 22, 2004
    #1
  2. DB

    ECCAD Guest

    (setq filename "F:/Autocad/acad_2004/support/cams/old_titles/title1.dwg")
    (if (findfile filename)
    (progn
    (setq new_file1 (strcat (getvar "dwgprefix") "title1.dwg"))
    (dos_copy filename new_file1); copy the file
    ); progn
    ); if
    (setq filename "F:/Autocad/acad_2004/support/cams/old_titles/title2.dwg")
    (if (findfile filename)
    (progn
    (setq new_file1 (strcat (getvar "dwgprefix") "title2.dwg"))
    (dos_copy filename new_file1); copy the file
    ); progn
    ); if
    ;; requires DOS_Lib loaded, from McNeal & Associates

    Bob
     
    ECCAD, Aug 23, 2004
    #2
  3. DB

    Jürg Menzi Guest

    Hi DB

    Visit my homepage -> Free Stuff and search for 'VxCopyFiles'.

    Cheers
     
    Jürg Menzi, Aug 23, 2004
    #3
  4. DB

    DB Guest

    Thanks for the help so far.

    This is the lisp routine

    (defun c:ct ()
    (setq filename
    "F:/Autocad/acad_2004/support/cams/old_titles/ghd_g_0043.dwg")
    (if (findfile filename)
    (progn
    (setq new_file1 (strcat (getvar "dwgprefix") "ghd_g_0043.dwg"))
    (dos_copy filename new_file1); copy the file
    ); progn
    ); if
    (setq filename
    "F:/Autocad/acad_2004/support/cams/old_titles/ghd_g_0045.dwg")
    (if (findfile filename)
    (progn
    (setq new_file1 (strcat (getvar "dwgprefix") "ghd_g_0045.dwg"))
    (dos_copy filename new_file1); copy the file
    ); progn
    ); if
    ;; requires DOS_Lib loaded, from McNeal & Associates

    When I load this it states - Command: ; error: malformed list on input

    Any idea what this could be ?

    Regards
    DB
     
    DB, Aug 23, 2004
    #4
  5. DB

    Tom Smith Guest

    That means parentheses don't match, check it in vlide.
     
    Tom Smith, Aug 23, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.