acad2000.lsp

Discussion in 'AutoCAD' started by bthatcher, Jun 3, 2004.

  1. bthatcher

    bthatcher Guest

    Is there a lisp file that Acad2005 loads and runs similar to the acad2000.lsp? I am looking to have a few routines to run with each DWG I open, not just load via the 'Startup Suite'. Thank you.
     
    bthatcher, Jun 3, 2004
    #1
  2. bthatcher

    BillZ Guest

    Acaddoc.lsp


    Bill
     
    BillZ, Jun 3, 2004
    #2
  3. bthatcher

    bthatcher Guest

    Where is that located. Or do I need to originate it. And if so do i put it in the support directory buried in the documents and settings folder? Thank you.
     
    bthatcher, Jun 3, 2004
    #3
  4. AcadDoc.lsp does not exist until it is created by a user. Place it in one of
    the folders listed in the support folders, but it would be best where you
    describe for roaming profiles.

    --
    R. Robert Bell


    Where is that located. Or do I need to originate it. And if so do i put it
    in the support directory buried in the documents and settings folder? Thank
    you.
     
    R. Robert Bell, Jun 3, 2004
    #4
  5. bthatcher

    BillZ Guest

    You make one.

    From the help files:

    Each time a drawing opens, AutoCAD searches the library path for an acaddoc.lsp file. If it finds one, it loads the file into memory. The acaddoc.lsp file is always loaded with each drawing regardless of the settings of ACADLSPASDOC and LISPINIT.

    Most users will have a single acaddoc.lsp file for all document-based AutoLISP routines. AutoCAD searches for an acaddoc.lsp file in the order defined by the library path; therefore, with this feature, you can have a different acaddoc.lsp file in each drawing directory, which would load specific AutoLISP routines for certain types of drawings or jobs.

    The acaddoc.lsp file can contain AutoLISP code for one or more routines, or just a series of load function calls. The latter method is preferable, because modification is easier. If you save the following code as an acaddoc.lsp file, the files mydocumentapp1.lsp, build.lsp, and counter.lsp are loaded every time a new document is opened.

    (load "mydocumentapp1")
    (load "build")
    (load "counter")
    AutoCAD searches for an acaddoc.lsp file in the order defined by the library path; therefore, you can have a different acaddoc.lsp file in each drawing directory. You can then load specific AutoLISP routines for certain types of drawings or jobs.

    Warning! Do not modify the reserved acad2004doc.lsp file. Autodesk provides the acad2004doc.lsp file, which contains AutoLISP-defined functions that are required by AutoCAD. This file is loaded into memory immediately before the acaddoc.lsp file is loaded.

    See Also

    Overview of File Organization
    Prevent AutoLISP Errors When Loading Startup Files

    Bill
     
    BillZ, Jun 3, 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.