Author Topic: The unknown command ?  (Read 1568 times)

0 Members and 1 Guest are viewing this topic.


  • Guest
The unknown command ?
« on: February 22, 2014, 02:22:51 AM »
  Why some commands that are defined and compiled by the user is suddenly unavailable after used for a period of time in the CAD? The commandline prompt the unknown command. But usually after resetting CAD the commands are available.What's the best way to solve the promble?


  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: The unknown command ?
« Reply #1 on: February 22, 2014, 04:06:33 AM »
It depends on the command, what happened after you used it and if you loaded it into your current DWG session as well. This is a question on: "How long is a string?"

E.g. some other (badly written) code could have placed a global variable in the same name as your command. So when you load the bad code it overwrites your command - thus no more command left to call.

Another problem is that LSP is only loaded for the current DWG. So you need some way to load it into all DWG's and even into new ACad sessions. That's where stuff like acad.lsp / acaddoc.lsp / startup suite / autoloads / CUI customization / etc. helps.

I could continue writing about various possibilities until the next ice age. The "best" way to avoid these is for the programmer to think about his/her "command" and decide on how to best get it always available. Then other programmers should NOT do stupid stuff like save global variables with c: prefixes - that would simply be begging for trouble.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.