Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom command shortcut not working

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
1485 Views, 3 Replies

Custom command shortcut not working

I wrote a program to add a user entered quantity to a dimension called "C:DimQuantity". I added the shortcut   "Q,     *DIMQUANTITY" at the very end of my PGP file. When I hit Q+enter, it gives this error message:

 

Command: q
c:\program files\autodesk\autocad mechanical 2012\acadm\amg3dim.arx cannot find
a dll or other file that it needs.
Unknown command "Q". Press F1 for help.

 

 

If I change the command name to just "C:Q" the program works fine. I have a bunch of other custom commands set up this way and they all work fine, it is just this one program that doesn't work.  Anybody know what's wrong?

3 REPLIES 3
Message 2 of 4
scot-65
in reply to: Anonymous

In my opinion it is best to keep separate the AutoCAD
command aliases (which references AutoCAD commands)
with your custom keyboard commands. Look into moving
all customization to ACADDOC.lsp or equal.

(defun c:Q () (load "TheDimQuantityFileName")(c:DimQuantity)(princ))

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 3 of 4
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

.... I added the shortcut ... at the very end of my PGP file. ....


Shot in the dark here, but that makes me wonder --

 

I'm not sure this is true of acad.pgp, but for some files, such as hatch-pattern definition files [.pat], the last line needs to be completed with an Enter, so that the end of the file is an empty last line, not the end of the last line of code.  If that's not true of your .pgp file, try adding that completing hard return, and see whether it fixes the problem.

Kent Cooper, AIA
Message 4 of 4
Anonymous
in reply to: Kent1Cooper

Well, it wasn't the very last line, just in the User Defined section. But the problem was that there were also some shortcuts defined for some other custom commands written by someone that worked here 10 years ago, and I had separated them from the commands I was writing and didn't realize that he had already had Q defined for a different command. I was getting the error because most of the stuff he wrote back then has since become obsolete and doesn't exist anywhere. I had just left them there because I didn't want to delete something and cause a problem, but now I'm probably going to go through them and see what I can get rid of, which I'm pretty sure is most of it.

 

Thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report