startup load

Discussion in 'AutoCAD' started by maryam, Jul 16, 2004.

  1. maryam

    maryam Guest

    Hi
    I have a lisp file that I have included in
    tools>load>startup suite.
    as I expect when ever I open AutoCAD this file must be loaded automatically.
    however when I open the program it doesn't start!!!!
    the name of the Startup function in the file is ana_startup.
    after I write (ana_startup) then the command runs and does what it suppose to do.

    any one knows what the problem is?...why this does not run by itself when I open AutoCad?

    I also would like to know that in a lisp file how does the compiler knows which function is the main function ( as we use to call it in C++? )
     
    maryam, Jul 16, 2004
    #1
  2. maryam

    ECCAD Guest

    If there is a function that looks like:
    (defun ana_startup ()....
    Add this line (after) the last line in that startup section.
    (ana_startup)
    If there is a function that looks like:
    (defun C:ana_startup ()...
    Add this line (after) the last line in that startup section:
    (C:ana_startup)

    Bob
     
    ECCAD, Jul 16, 2004
    #2
  3. maryam

    Tom Smith Guest

    Files listed in the startup suite are loaded in each drawing. They are not
    executed automatically. Loading a lisp file does not cause it to run.

    The usual way to cause a function to run automatically is to name it
    s::startup -- look it up in the developer's help.

    Another way would be to simply put the statement (ana_startup) at the end of
    the lisp file, so that the function is called and executed when the lisp
    file loads.
     
    Tom Smith, Jul 16, 2004
    #3
  4. maryam

    maryam Guest

    thanks bob
    you are an angel
    I made another lisp file and I put (ana_startup)
    in it, and I loaded it at startup. now it works. So there is no Main function you have to tell AutoCAD what function to run first right?
     
    maryam, Jul 16, 2004
    #4
  5. maryam

    ECCAD Guest

    Well, yes and no.
    A 'function' is named when you do (defun myname..
    During an AutoCAD session, if you have that 'function' loaded, you can call it for service. e.g. (myname)..
    Startup files (acaddoc.lsp, acad.lsp, etc) can 'load' the functions you need. To make them (auto-load), - somewhere in the 'startup' suite (programs above), you need to 'call' that function, or when expanding a Macro on a Menu, for example, you could do [Load MyName function]^^(myname)

    See the Help files, check out S::STARTUP function also..

    Bob
     
    ECCAD, Jul 16, 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.