lisp command does not run even though loaded

Discussion in 'AutoCAD' started by akniff1, Feb 23, 2004.

  1. akniff1

    akniff1 Guest

    I used APPLOAD to load a lisp command in the start up suite but it still doesn't work properly.
    Sometimes it may work, but mostly it doesn't.

    Any ideas?

    Thanks for your help.
     
    akniff1, Feb 23, 2004
    #1
  2. akniff1

    BillZ Guest

    The loading of the lisp file has nothing to do with how the program works. Either it loads or it doesn't load.
    What is the program supposed to do?
    If it's loading, and everything in the syntax is correct, then it should run when executed by either typing the command name at the command line and hitting enter or have it in another lisp routine.
    Can you post it so we can look at it?

    Bill
     
    BillZ, Feb 23, 2004
    #2
  3. akniff1

    akniff1 Guest

    Bill-

    The following is the lisp command being used.
    ;
    ;
    ; **** le - This routine changes the current layer to the selected entity's ****
    ;
    ;
    (defun L:le (/ x )
    (setq x (entsel "\nSelect Entity To Make Current Layer: "))
    (command "layer" "S" (cdr (assoc 8 (entget (car x)))) "")
    (princ)
    );defun c:le

    It worked fine in AutoCAD 2000i, and our office is now using 2004.
    In trying to solve the problem I did find something interesting.
    When I first open the ACAD program the command will work in the new drawing that opens automatically.
    Yet when I open a previously saved drawing or even create a new one (not the 1st as mentioned above) the command will not work.

    Thanks for your help
     
    akniff1, Feb 23, 2004
    #3
  4. Options > System Tab > Load acad.lsp with every drawing checked?
     
    Allen Johnson, Feb 23, 2004
    #4
  5. akniff1

    urugx Guest

    Should'nt it be (defun C:Le ().....
     
    urugx, Feb 23, 2004
    #5
  6. akniff1

    BillZ Guest

    It doesn't sound like a routine problem.
    First I would'nt use appload when you can use the (load function.
    Where are you loading the routine from.
    If it's your acad.lsp file, it will only load on startup if the ACADLSPASDOC variable is set to 0.
    If you load your lisp in the acaddoc.lsp it will be loaded everytime a drawing is opened.
    Are you using SDI = 1 or 0? This will make a difference too.

    Bill
     
    BillZ, Feb 23, 2004
    #6
  7. akniff1

    ECCAD Guest

    akniff1,
    Don't use appload just to load into 'applications' loaded area.
    Do: load from acad.lsp or acad2000doc.lsp. This way, no matter what drawing gets opened, it should be available.

    Bob
     
    ECCAD, Feb 23, 2004
    #7
  8. akniff1

    akniff1 Guest

    Thank you.
    We just upgraded to 2004 & I've had trouble remembering how all my options were set up in 2000i.
     
    akniff1, Feb 23, 2004
    #8
  9. akniff1

    akniff1 Guest

    Thanks to everyone for their help.
     
    akniff1, Feb 23, 2004
    #9
  10. akniff1

    Paul Turvill Guest

    Why? The posted code uses (/ x) to localize the x variable.
    ___
     
    Paul Turvill, Feb 23, 2004
    #10
  11. akniff1

    Casey Guest

    I think urugx was pointing out the fact that the command is defined as

    defun L:

    and not

    defun C:

    Casey
     
    Casey, Feb 23, 2004
    #11
  12. Don't: Use Acad2000Doc.lsp
    Do: Use AcadDoc.lsp

    See http://tinyurl.com/9kxi for Autodesk's stance.


    --
    R. Robert Bell, MCSE
    www.AcadX.com


    akniff1,
    Don't use appload just to load into 'applications' loaded area.
    Do: load from acad.lsp or acad2000doc.lsp. This way, no matter what drawing
    gets opened, it should be available.

    Bob
     
    R. Robert Bell, Feb 23, 2004
    #12
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.