a small query about what happens first.

Discussion in 'AutoCAD' started by Jamie Duncan, Apr 30, 2004.

  1. Jamie Duncan

    Jamie Duncan Guest

    In my a2k setup it's set so that:
    acad.lsp loads everytime.
    and s::startup thingy points to a file called asofstrt.lsp - which sets up global variables for paths,.
    It then loads and runs asofstau.lsp - which sets up standard functions and does a check on the drawing wrt whether it has had drawing setup run on it etc.
    This while a partial menu and it's .mnl file loads as well.


    Now I'm working on a2k4, and I'm wondering if I can simplify things. Can I get rid of the s::startup thing, and take the info from the two files - asofstrt and asofstau - and put them in my menu file? Or should I at least have a menu loader and autoloader setup and then let the .mnl file set up the rest of the environment?


    I als9o have the vl-load-com thing in one of the files - can that be moved to the .mnl file?


    Thanks.
     
    Jamie Duncan, Apr 30, 2004
    #1
  2. You could move all that code to the .mnl file.

    Here are a few additional considerations:

    S::Startup runs only when the drawing is fully loaded. If your code may
    depend on that condition, you will want to append the S::Startup function
    from your .mnl file.

    You should only be appending to S::Startup (setq S::Startup (append
    S::Startup MyStartup)), not defining it (defun S::Startup () ...). See the
    docs for more info.

    You could leave the two external lisp files (asof*.lsp) as separate files,
    and simply load them in the .mnl file with the (load) function.

    The .mnl file is a great place for the (vl-load-com) statement.


    P.S. Once a menu is loaded via the menuload command, AutoCAD will continue
    to load it session after session, until you unload it.

    --
    R. Robert Bell


    In my a2k setup it's set so that:
    acad.lsp loads everytime.
    and s::startup thingy points to a file called asofstrt.lsp - which sets up
    global variables for paths,.
    It then loads and runs asofstau.lsp - which sets up standard functions and
    does a check on the drawing wrt whether it has had drawing setup run on it
    etc.
    This while a partial menu and it's .mnl file loads as well.


    Now I'm working on a2k4, and I'm wondering if I can simplify things. Can I
    get rid of the s::startup thing, and take the info from the two files -
    asofstrt and asofstau - and put them in my menu file? Or should I at least
    have a menu loader and autoloader setup and then let the .mnl file set up
    the rest of the environment?


    I als9o have the vl-load-com thing in one of the files - can that be moved
    to the .mnl file?


    Thanks.



    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    R. Robert Bell, Apr 30, 2004
    #2
  3. Jamie Duncan

    Jamie Duncan Guest

    Thanks Robert,.

    I have the setq S::startup set that way. I think the mnl is the natural
    progression for all of these things, and eliminates an error I was getting
    whereby the .mnl seemed to want to load in between the first and second
    files. I would get an error of function not found, which disappeared when
    the fucntion became defined.

    I have just one question for you. Do you have a 'clean' copy of the .mnl
    file? I seemd to have solved most of my menu queries and upgrade issues to
    2004, but in the testing process I got a little heavy handed and I think I
    mushed the .mnl file to an acad 2000 version as the copyright says 1992 to
    1997 and not 1997 ro 2002


    Thanks for the help.



    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Apr 30, 2004
    #3
  4. Jamie Duncan

    Warren Trost Guest

    Question about the .mnl file. I use more than one menu depending on what I
    want to do. I load from the ACADDOC.lsp file, approx. 108k of my shortcuts,
    so it is not menu dependant. I have used the .mnl before. What are your
    ideas pro and con of each way?
     
    Warren Trost, Apr 30, 2004
    #4
  5. Jamie Duncan

    Jamie Duncan Guest

    I think that functions that you want available regardless of the menu should
    be where you have them.

    Menu dependant functions and general lisp for the particular menu should
    reside in the .mnl.

    That's my current thinking right now.



    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Apr 30, 2004
    #5
  6. Sorry Jamie, I only have 2005 now.

    --
    R. Robert Bell


    Thanks Robert,.

    I have the setq S::startup set that way. I think the mnl is the natural
    progression for all of these things, and eliminates an error I was getting
    whereby the .mnl seemed to want to load in between the first and second
    files. I would get an error of function not found, which disappeared when
    the fucntion became defined.

    I have just one question for you. Do you have a 'clean' copy of the .mnl
    file? I seemd to have solved most of my menu queries and upgrade issues to
    2004, but in the testing process I got a little heavy handed and I think I
    mushed the .mnl file to an acad 2000 version as the copyright says 1992 to
    1997 and not 1997 ro 2002


    Thanks for the help.



    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    R. Robert Bell, May 1, 2004
    #6
  7. Sorry Jamie, I checked, I don't have it.

    < snip >
     
    michael puckett, May 1, 2004
    #7
  8. Jamie Duncan

    Bill DeShawn Guest

    One observation.
    TYPE is already an AutoLISP command:

    Command: !type
    #<SUBR @021e749c TYPE>

    When you create a global variable that redefines the function, you can run into problems with other routines. Take care that you localize variables as one reader has already mentioned. Also, variable names like type can be something else like etype or typent.
    Keep in touch.

    --
    Bill DeShawn

    http://my.sterling.net~bdeshawn

    In my a2k setup it's set so that:
    acad.lsp loads everytime.
    and s::startup thingy points to a file called asofstrt.lsp - which sets up global variables for paths,.
    It then loads and runs asofstau.lsp - which sets up standard functions and does a check on the drawing wrt whether it has had drawing setup run on it etc.
    This while a partial menu and it's .mnl file loads as well.


    Now I'm working on a2k4, and I'm wondering if I can simplify things. Can I get rid of the s::startup thing, and take the info from the two files - asofstrt and asofstau - and put them in my menu file? Or should I at least have a menu loader and autoloader setup and then let the .mnl file set up the rest of the environment?


    I als9o have the vl-load-com thing in one of the files - can that be moved to the .mnl file?


    Thanks.
     
    Bill DeShawn, May 1, 2004
    #8
  9. Jamie Duncan

    ECCAD Guest

    Jamie,
    See your E-Mail box.
    Bob
     
    ECCAD, May 1, 2004
    #9
  10. Jamie Duncan

    Jamie Duncan Guest

    Thanks Bob,

    as it turns out I was okay, I just didn't believe the dates on the copyright
    notice.


    Jamie Duncan
     
    Jamie Duncan, May 1, 2004
    #10
  11. Jamie Duncan

    Warren Trost Guest

    Thanks. I agree. I just wanted other opinions.
     
    Warren Trost, May 3, 2004
    #11
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.