Load ACAD.LSP into every drawing

Discussion in 'AutoCAD' started by DFrank, Apr 30, 2004.

  1. DFrank

    DFrank Guest

    What are the pros and cons of this setting?
     
    DFrank, Apr 30, 2004
    #1
  2. DFrank

    Walt Engle Guest

    I wouldn't do without it. I have many particular settings that I want
    and acad.lsp does this for me. Woudn't do without it.
     
    Walt Engle, Apr 30, 2004
    #2
  3. There are many ways to save "Custom Programs" in AutoCAD.
    I believe that modifying the ACAD.LSP is not the best method.
    Problems can arise if you have to reinstall or upgrading AutoCAD.
    Acad.lsp file may change from version to version.
    I create a ACADDOC.LSP file that resides in the "Start In" folder.
    To find the "Start In" folder - Right Click on Acad Icon, pick
    properties.
    This file gets loaded every time a new drawing is created or an existing
    drawing is opened.

    This means that I can have different Icons to load different types of
    projects with unique ACADDOC.LSP files.
     
    Alan Henderson @ A'cad Solutions, Apr 30, 2004
    #3
  4. DFrank

    C Witt Guest

    if you were to leave your acad.lsp file in a "standard" acad folder..
    then perhaps. but why not make a new folder separate from autocad that
    holds all your lisp?? just add the dir to your support paths.. and
    autocad will load the acad.lsp file by default. you never have to worry
    about upgrades.
     
    C Witt, Apr 30, 2004
    #4
  5. DFrank

    Walt Engle Guest

    Leave acad.lsp in the Support folder. Nothing changes with it when, and if, an
    upgrade comes along. Acad.lsp allows me to set variables as I want them, make
    laters, linetypes, colors, text, text height and a host of other items. Have
    used it since R8. Ocassionally add or subtract from it, but still use it. I do
    put all my lsp routines in a separate folders so that I can find them easily
    and modify them from time to time. Upgrading does not change the acad.lsp.
     
    Walt Engle, Apr 30, 2004
    #5
  6. DFrank

    C Witt Guest

    I am aware that the acad.lsp file is not changed when upgrading.. I was
    just saying that is it a good idea (at least that i have found) to keep
    ALL custom/modded lisp separate.
     
    C Witt, Apr 30, 2004
    #6
  7. Jon,
    You are correct. This is from the AutoDESK website.

    Comparing acad*.lsp files
    AutoCAD 2000 uses different startup files for the automatic loading of
    AutoLISP, when compared to previous versions of AutoCAD. This solution
    discusses the user-defined startup files acad.lsp and acaddoc.lsp, and the
    reserved startup files acad2000.lsp and acad2000doc.lsp.

    Solution
    acad.lsp
    When you start AutoCAD, it searches the library path for a file called
    acad.lsp. If the file is found, AutoCAD loads it. AutoCAD loads acad.lsp
    once only, at the beginning of the drawing session.
    Functions and variables defined in acad.lsp are only available in the first
    drawing in an AutoCAD session. If you want a routine to be available in all
    drawings in the session, include it in the user-defined startup file
    acaddoc.lsp
    Note: AutoCAD 2000 is not supplied with the user defined startup file
    acad.lsp; you create and maintain the file yourself.

    acaddoc.lsp
    Every time a drawing opens (that is, when you start a new drawing or open an
    existing drawing), AutoCAD searches the library path for a file called
    acaddoc.lsp. If the file is found, AutoCAD loads it.
    Note: AutoCAD always loads acaddoc.lsp regardless of the settings for the
    ACADLSPASDOC and LISPINIT system variables.
    Functions and variables defined in acaddoc.lsp are available in all drawings
    in the AutoCAD session.
    In most situations, you only need one acaddoc.lsp file, but you can use
    different versions of the file. For example, because AutoCAD searches the
    library path for acaddoc.lsp, you could place a different acaddoc.lsp in
    each drawing directory. Then AutoCAD would load specific AutoLISP routines
    for certain
    types of drawings or jobs
    Note: AutoCAD 2000 is not supplied with the user?defined startup file
    acaddoc.lsp; you create and maintain the file yourself.

    ACADLSPASDOC system variable
    You can use ACADLSPASDOC to override the recommended functionality of
    acad.lsp and acaddoc.lsp. If ACADLSPASDOC is set to 0 (the default setting),
    acad.lsp is loaded once, at the beginning of the drawing session. If
    ACADLSPASDOC is set to 1, acad.lsp is reloaded every time a drawing opens.

    ACADLSPASDOC and SDI mode
    ACADLSPASDOC is ignored in SDI (single document interface) mode. When the
    SDI system variable is set to 1, LISPINIT controls the reinitialization of
    AutoLISP between drawings. When LISPINIT is set to 1, AutoLISP functions and
    variables are valid in the current drawing only; each time you start a new
    drawing or open an existing one, all functions and variables are cleared
    from memory and acad.lsp is reloaded. Changing the value of LISPINIT when
    SDI is set to 0 has no effect.

    acad2000.lsp
    Do not modify the reserved file acad2000.lsp; it contains AutoLISP?defined
    functions required by AutoCAD. The file acad2000.lsp is loaded into memory
    immediately before acad.lsp.

    acad2000doc.lsp
    Do not modify the reserved file acad2000doc.lsp; it contains
    AutoLISP?defined functions required by AutoCAD. The file acad2000doc.lsp is
    loaded into memory immediately before acaddoc.lsp.

    Email me if you have any questions, I am willing to try to help any way I
    can.
    Please note, that I am human and occaissionaly make mistakes.
    Condescention in replies is very unprofessional and just not nice.
     
    Alan Henderson @ A'cad Solutions, May 1, 2004
    #7
  8. DFrank

    Doug Broad Guest

    For installations with the most basic customization, using
    acad.lsp and setting it to load with every drawing is sufficient.
    Autodesk, by offering the Acaddoc.lsp feature implies that
    using Acaddoc.lsp is the preferred method for 2000+
    for loading document specific code. It was probably
    intended to be helpful for those transitioning from R14 to
    2000.

    Using both acad.lsp and acaddoc.lsp and setting acad.lsp
    to load only once can have advantages. For example,
    anything that you want to run just once per autocad
    session can be put in acad.lsp, while things that should
    load with every drawing can be put in acaddoc.lsp.

    I use acaddoc.lsp for my s::startup files which re-define
    certain commands and launch my keyboard macros,
    which speed up my autocad drawing work.

    I left my acad.lsp so that it worked well with R14 and
    checks certain system variables that IMO should be set
    a certain way, like rememberfolders. Acad.lsp could
    also be used to launch vba event handlers that pertain
    to all documents instead of each single document. I don't
    currently do this.

    Regards,
    Doug
     
    Doug Broad, May 1, 2004
    #8
  9. I didn't see anything condescending in your post.
     
    Tony Tanzillo, May 2, 2004
    #9
  10. Then what was the purpose of "Er,"? I haven't been responding to this NG for
    very long, but I notice a lack of respect and professionalism many times
    among the responders. If you want me to spend the time, I could come up with
    MANY examples. Compared to some of the responses I've seen, the reponse to
    my mis-information was mild (in my opinion). But that does not excuse
    anyone's attitudes. I know people have bad days, but I thought that this NG
    is to help people. People make mistakes, sometimes are mis-informed or what
    ever. A polite acknowledgement or contructive criticism of any of my error
    is readily taken. I enjoy learning new techniques and methods. Also, I am
    here to try to help, because when I started writing programs 19 years ago,
    there wasn't any help that I knew about. So I understand other's frustration
    with learning AutoLISP and AutoCAD.
     
    Alan Henderson @ A'cad Solutions, May 3, 2004
    #10
  11. DFrank

    Jeff Mishler Guest

    FWIW, I took the "Er,...." more like an "Excuse me, but I think...."

    I know that if someone responded to one of my posts and started out with
    "Er, ..." that I wouldn't be offended, unless they continued on with "Er,
    you are so full of it....."

    So IMHO there is a difference.

    And yes, we've all made mistakes and some get to point them out more than
    others. I just try to learn and carry on.

    Jeff
     
    Jeff Mishler, May 3, 2004
    #11
  12. DFrank

    Walt Engle Guest

    Hmmm....I am not sure, but it appears that you have quoted portions from
    autodesk. If this is so, I wish to correct something that you have posted:

    "Solution
    acad.lsp
    When you start AutoCAD, it searches the library path for a file called
    acad.lsp. If the file is found, AutoCAD loads it. AutoCAD loads acad.lsp
    once only, at the beginning of the drawing session.
    Functions and variables defined in acad.lsp areonly available in the first
    drawing in an AutoCAD session. If you want a routine to be available in all
    drawings in the session, include it in the user-defined startup file
    acaddoc.lsp"

    The sentence in the quoted paragraph above that I don't agree with is colored
    red. I have used an acad.lsp for many years and all the variables, setting, etc
    listed in it are available for ALL drawings opened during a session. To make
    this explicitly clear, I can open a dwg, work on it, quick-save it and open
    another or start a new dwg. In either or both later cases, the settings,
    variables, etc from my acad.lsp are always there - ready.

    As a side note, concerning the last sentence in the quoted text above, I have
    all my lsp routines (that I want to use) available to me via my acad.mnu, i.e.,
    when I have something special in my menu that requires the use of one of my
    routines, I pick it and it loads and initiates the routine. Note too that this
    applies to my toolbars.
     
    Walt Engle, May 3, 2004
    #12
  13. DFrank

    DFrank Guest

    All:

    Thanks for the responses, they clears up a few thoughts.

    I have been using ACAD since v2.6 and have customized acad.lsp extensively.
    I have not customized any of the other "global" .lsp files at all.
    Acad<ver>doc.lsp seems to have all adesk customization in it so I leave that
    one alone. I could add my customization to acad<ver>.lsp but could not
    understand why I would do that since I already had it in acad.lsp. I guess
    if a company is running different versions it would be helpful, but I had
    always solved that one by "(if (= (acadver...". Our acad.lsp loads simple
    macros that are used for all drawings, loads arx functions, and sets sysvars
    to standards.
     
    DFrank, May 3, 2004
    #13
  14. DFrank

    C Witt Guest

    yea, to make acad.lsp availible to all drawings opened.. go into
    config>system tab>general options>"load acad.lsp with every drawing"
     
    C Witt, May 3, 2004
    #14
  15. DFrank

    Tom Smith Guest

    Walt, that is controlled by acadlspasdoc, which can be set in Options.
    "Controls whether AutoCAD loads the acad.lsp file into every drawing or just
    the first drawing opened in an AutoCAD session." The default is 0 -- load
    acad.lsp only in the first drawing.

    The first time you run a new installation, you get a pop-up asking in a
    confusing way whether you want acad.lsp always loaded. I'd assume that you
    said yes to this and therefore set your acadlspasdoc to 1. It's not a
    difference of opinion, it's a variable setting.

    I leave acadlspasdoc=0 so that I can use both acad.lsp and acaddoc.lsp.
    There are some things I only want done once per session, and some things I
    want in every drawing.
     
    Tom Smith, May 5, 2004
    #15
  16. DFrank

    Walt Engle Guest

    Ok. I prefer to load my acad.lsp into every dwg so that I get ALL the settings I
    want. Just a matter of choice.
     
    Walt Engle, May 5, 2004
    #16
  17. DFrank

    Tom Smith Guest

    Just a matter of choice.

    I'm not arguing preferences. I use acadlspasdoc=0 so that I can have an
    extra degree of control of when different things load. Having both acad.lsp
    and acaddoc.lsp available provides another layer of functionality.

    How much you personally choose to do in each drawing is the preference part.
    To each his own. I deal with drawings that are highly consistent & I simply
    have no need to do a lot of stuff in every drawing. In another environment,
    I used to do something like what you seem to be doing, but now I don't need
    to. If I had any reason to manipulate "ALL" settings, I'd want to do it on
    entering every drawing, and I'd use acaddoc.lsp for that.

    In our setup, acaddoc.lsp is a user-preference file, not part of the
    company-standard setup. Standard things that need to happen in each drawing
    are done a different way (via an mnl), allowing the individual user to use
    acaddoc.lsp for his own purposes. Few do, but the capability is there. If
    they're clever enough, they can do whatever they want in every drawing file,
    within the range of our QC standards.

    On the other hand, there's an administrative thing or two that I only want
    done about once a day, and acad.lsp gives me a way to do that without
    involving the IT group. It's something I'm just experimenting with, but
    we'll end up with a company-standard acad.lsp -- not user-configurable --
    which for performance and network traffic reasons I specifically *don't*
    want running every time anyone opens a drawing.

    Having both types of file loading available gives me different ways to
    accomplish entirely different things.
     
    Tom Smith, May 5, 2004
    #17
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.