Lisp not working

Lisp not working

twallacemagee
Enthusiast Enthusiast
1,842 Views
7 Replies
Message 1 of 8

Lisp not working

twallacemagee
Enthusiast
Enthusiast

I have the following lines in my keycad.lsp that have work perfectly fine for me up until mid November 2021.  Now they either do not work or return "unknown command".  Most of these I have had and used for over 25 years.

 

I am using AutoCAD Architecture 2022.  Can anyone help me?  Note the first 6 are the most critical to me.

 

(defun c:le () (command "leader" pause pause pause "" "" "none"))
(defun c:lt () (command "leader" pause pause pause "" "" "None" "dtext" "j" "ml" pause "" "" "dtext" "j" "l" ^C^C))
(defun c:st () (command "stretch" "c"))
(defun c:stc () (command "stretch" "cp"))

(defun c:xa () (command "-xref" "attach" "~"))
(defun c:xrr () (command "-xref" "r" "*"))
(defun c:x? () (command "xref" "?" "*"))

(defun c:i? () (command "insert" "?" "*"))
(defun c:la? () (command "layer" "?" "*"))
(defun c:ua () (command "undo" "b" ""))

(defun c:osm () (command "osmode" "97"))
(DEFUN C:OS0 () (COMMAND "OSMODE" "0"))

 

0 Likes
1,843 Views
7 Replies
  • Lisp
Replies (7)
Message 2 of 8

pendean
Community Legend
Community Legend
What changed with your PC or setup since November? "unknown command" in this case simply means your keycad.lsp is not in the search path of your session/not in a folder tagged as trusted, not much else. Just like the same if it was also missing in all other year versions/variants of AutoCAD in the past.
0 Likes
Message 3 of 8

twallacemagee
Enthusiast
Enthusiast

That is what I would like to know.  There have been some windows updates I am not sure if there were recent AutoCAD updates since they stopped working. Please note that these are not the only short commands that are in my Keycad.lsp about half of them still work like they are but these and a few others suddenly do not.  The lisp is in a “trusted location”.  The folder has never been added to the working support file search path but it has and again still partially does work.

 

If I type "stretch" "c" (for crossing window) and select points it works exactly like the ST short command is intendded to work.  If I type -xref Attach, etc. it all works like intended.

0 Likes
Message 4 of 8

pendean
Community Legend
Community Legend
>>>... my Keycad.lsp about half of them still work like they are but these and a few others suddenly do not...<<<
Can you share that single LSP file here for others to try? Seems odd that half a LSP file's content work, the other half do not (or whatever the ratio is).
0 Likes
Message 5 of 8

dbroad
Mentor
Mentor

If you've been using these for 25 years, perhaps it's time to change to work with the advances made in AutoCAD. Before analyzing your commands, my first thought to why these might not be working is that, if you've recently upgraded, you may not have 1. added the locations of the file that contains these commands and/or 2. added the folders as trusted locations. Both of these can be done in your profile.

BTW: This is not a customization forum.  I am reporting that the thread should be moved to the customization forum.

 

As far as the commands,

  • Adding leaders without content is something that should be done very rarely, such as to show a sliding window direction.  I doubt it deserves a shortcut.
  • C:LT - Not using the built in capabilities of multileaders to add text seems like a big waste.  Why keep separate leader and text content objects that can be separated from one another?  Why use dtext, which has no flow adjustments?
  • C:ST - Stretch already has an alias  "S".  If you learn to pick right side first, you never need to enter the "C".
  • C:XA - I get this but the full command name is _.xattach, including the translation and command override characters.
  • C:XRR & C:X? - These commands seem like a real waste.  The xref palette, which can autoshrink, can be used for both purposes and doesn't require toggling to the textscreen.
  • C:I?  -  The Current I shortcut has a dialog that lists the loaded blocks.  The ribbon also has a gallery of blocks.  Learn to use the improvments since R12.
  • C:la? - Really?  What's wrong with the layer palette? (Alias LA unless, you've redefined it.)
  • C:UA - Sounds scary to put this on a shortcut key?  Do this a lot?
Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 6 of 8

twallacemagee
Enthusiast
Enthusiast

See attached.  Also attached PDF of the ones that I care about and what is happening when I try to use them.

0 Likes
Message 7 of 8

twallacemagee
Enthusiast
Enthusiast

Why change what works?  At least until AotoCAD breaks what works.  This is not an issue of being in the wrong location unless AutoDesk changes some pathing in the last few weeks updates as they worked fine with AutoCAD 2022 since I installed it when it was first released.

0 Likes
Message 8 of 8

diagodose2009
Collaborator
Collaborator

I try convert the keycad.lsp into more-programe.

Advantages. You can add more check-in (Example: ViewState no saved)

Please, you test this version, for funny, I add one file snapshot.gif

You tell me, I continue to work, this test version, is good enough, now?

 

0 Likes