Autoload Lisp

Discussion in 'AutoCAD' started by dbeach, May 27, 2004.

  1. dbeach

    dbeach Guest

    Using AutoCAD 2002 and LDD3
    I have several lisp (that I did not write nor do I know how to) that I use and put them in a folder on the network drive and then mapped it on the Support File Search Path, but they still will not load! If I load using "start up suite" they all execute after opening a drawing and I have to escape out of the commands.

    I read several discussions on this and still do not get it. Can anyone please help me to auto load these??

    Thanks in advance
     
    dbeach, May 27, 2004
    #1
  2. dbeach

    TCEBob Guest

    To expand:

    All lisp programs that run from the command line start with (defun c:something .
    .. . This is NOT the line that Matt is referring to! Delete that line and you are
    totally out of business. Better not to delete a line anyway. Instead, "comment"
    it by inserting a ; in front.

    rs

    matter how you load it it will run right after you load it. To change that you
    have to look at the code to see if that is the reason, if so then you have to
    erase the line of code where it calls itself. Then when you put it in your
    start-up suite it should be ok.
     
    TCEBob, May 27, 2004
    #2
  3. dbeach

    dbeach Guest

    Hey it worked :)

    thanks for all your help everyone, I really appreciate it!!

    -Devon


    Message was edited by: dbeach
     
    dbeach, May 27, 2004
    #3
  4. dbeach

    R.K. McSwain Guest

    To further expand, may there are no (defun)'s at all.

    I frequently do this so that the code contained in the .LSP file will execute when it is loaded. See below.



    TEST.LSP
    =================================
    (do_something)
    (do_some_more)
    (princ)
    =================================


    SHORTCUT.LSP
    =================================
    (defun c:test ()(load"test"))
    =================================



    This way, if I make a change to "test.lsp", I don't have to reload it, and the code does not stay in memory.
     
    R.K. McSwain, May 27, 2004
    #4
  5. <blech> (Sorry, I had to say it. <bg>)

    And how do you handle localizing variables? Seems that the "cure" is worse
    than the reason behind that approach. After all, how hard is it to reload a
    modified routine? How often do you modify a routine? How tight is the memory
    on the computer?

    --
    R. Robert Bell


    To further expand, may there are no (defun)'s at all.

    I frequently do this so that the code contained in the .LSP file will
    execute when it is loaded. See below.



    TEST.LSP
    =================================
    (do_something)
    (do_some_more)
    (princ)
    =================================


    SHORTCUT.LSP
    =================================
    (defun c:test ()(load"test"))
    =================================



    This way, if I make a change to "test.lsp", I don't have to reload it, and
    the code does not stay in memory.
     
    R. Robert Bell, May 27, 2004
    #5
  6. dbeach

    R.K. McSwain Guest

    Usually reserve this method for small routines with few or no variables.
    It doesn't matter anyway, the lisp enviroment at this office is so polluted anyway - restarts are necessary all the time anyway :)
    (No - I do not have any control over this mess...)
    I wasn't trying to suggest a 'cure', and I didn't suggest to start coding this way. I was only pointing out another possibility regarding the original problem.

    Not hard at all....for me.
     
    R.K. McSwain, May 27, 2004
    #6
  7. Glad you took my post so well... I was worried you might not. I thought
    those points are important enough for the lurkers to mention.

    <whew>

    --
    R. Robert Bell


    Usually reserve this method for small routines with few or no variables.
    It doesn't matter anyway, the lisp enviroment at this office is so polluted
    anyway - restarts are necessary all the time anyway :)
    (No - I do not have any control over this mess...)
    I wasn't trying to suggest a 'cure', and I didn't suggest to start coding
    this way. I was only pointing out another possibility regarding the original
    problem.

    Not hard at all....for me.
     
    R. Robert Bell, May 27, 2004
    #7
  8. dbeach

    R.K. McSwain Guest

    No problems here....

    It must be frustrating to not understand lisp and then try and use lisp routines that have no instructions. But, it looks like the OP got what he wanted, and that's all that matters anyway.... :)
     
    R.K. McSwain, May 27, 2004
    #8
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.