Results 1 to 9 of 9

Thread: Lisp command not recognised

  1. #1
    Active Member
    Join Date
    2001-10
    Location
    Waukegan, IL
    Posts
    52
    Login to Give a bone
    0

    Default Lisp command not recognised

    Long ago I adapted a bit of Lisp code from George Omura's Keycad.lsp routine that combines several keyboard shortcuts into a single shortcut. It has worked well for me, except that one of the shorcuts has stopped working.

    The command is designed to set the fillet command to have a 0" radius when the shortcut "ff" is entered. The line in question is as follows:

    (DEFUN C:FF () (COMMAND "FILLET" "RADIUS" "0"))

    When I try to use the shortcut, the following message appears in the command line:

    Command: ff
    FILLET Unknown command "FILLET". Press F1 for help.
    Command: RADIUS Unknown command "RADIUS". Press F1 for help.
    Command: 0 Unknown command "0". Press F1 for help.
    Command: nil

    If I enter "FILLET" or "F" in the command line, the Fillet command is recognised and works normally.

    Any clues?

  2. #2
    Active Member
    Join Date
    2001-10
    Location
    Waukegan, IL
    Posts
    52
    Login to Give a bone
    0

    Default Re: Lisp command not recognised

    Oh, in case it matters, I'm running ADT 2005.

  3. #3
    100 Club
    Join Date
    2000-12
    Posts
    126
    Login to Give a bone
    0

    Default Re: Lisp command not recognised

    Quote Originally Posted by jnj1502
    Oh, in case it matters, I'm running ADT 2005.
    Yes it matters cos' FILLET has changed in 2005. The best I can come up with here and now is to set radius separately and then start the command:

    (DEFUN C:FF ()
    (and (setvar "FILLETRAD" 0.0) (princ "Radius = 0.0"))
    (COMMAND "FILLET")
    (princ)
    )

  4. #4
    Active Member
    Join Date
    2001-12
    Location
    North Carolina, USA
    Posts
    52
    Login to Give a bone
    0

    Default Re: Lisp command not recognised

    ADT undefines several commands and substitutes its own in order make it possible to use apparently AutoCAD commands to modify ADT elements. This can adversly affect customizations. Use (command "_.Fillet") to get access to the AutoCAD command or use (command "_AECfillet") if you want it to work on ADT elements. In general it is good to use a "_." prefix for commands so that
    they are unaffected by command redefinition.

  5. #5
    100 Club
    Join Date
    2000-12
    Posts
    126
    Login to Give a bone
    0

    Default Re: Lisp command not recognised

    Excellent point, dbroad

  6. #6
    Active Member
    Join Date
    2001-10
    Location
    Waukegan, IL
    Posts
    52
    Login to Give a bone
    0

    Default Re: Lisp command not recognised

    Thanks to you both. My shortcut is working again.

    What other commands require the "_." prefix in order to be used in LISP routines within ADT?

  7. #7
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Lisp command not recognised

    thats all you use???
    mine looks like this


    ;Zero Fillet
    ;-----------
    (defun c:FZ ()
    (setq Save_FilletRad (getvar "FILLETRAD"))
    (setq Save_TrimMode (getvar "TRIMMODE"))
    (setvar "FILLETRAD" 0)
    (setvar "TRIMMODE" 1)
    (setvar "CMDECHO" 1)
    (command "._FILLET")
    (while (> (getvar "CMDACTIVE") 0)
    (command pause)
    )
    (setvar "FILLETRAD" Save_FilletRad)
    (setvar "TRIMMODE" Save_TrimMode)
    (princ)
    )



    Maybe I have more here than I need?

  8. #8
    Active Member
    Join Date
    2001-12
    Location
    North Carolina, USA
    Posts
    52
    Login to Give a bone
    0

    Default Re: Lisp command not recognised

    In general, its safe to add "_." to all command calls. Always test.
    You may use the "_" prefix for subcommands but don't use "_."
    The underscore is a translation prefix, enabling the same code to
    be used for international versions of ACAD/ADT/....

  9. #9
    Active Member
    Join Date
    2001-12
    Location
    North Carolina, USA
    Posts
    52
    Login to Give a bone
    0

    Default Re: Lisp command not recognised

    I don't bother saving filletrad because I usually want to keep filleting at 0 after FZ.

Similar Threads

  1. 2014: Raster tools not recognised
    By john-jr in forum Raster Design - General
    Replies: 9
    Last Post: 2016-03-29, 11:23 AM
  2. Replies: 3
    Last Post: 2009-10-22, 10:19 PM
  3. Search Path not recognised?
    By mtc.139414 in forum AutoCAD Customization
    Replies: 1
    Last Post: 2007-12-13, 08:13 PM
  4. Replies: 2
    Last Post: 2004-09-11, 03:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •