broncos15 Posted October 26, 2015 Posted October 26, 2015 I created a simple code for AutoCAD 2013, that is having some issues in 2015. It will run correctly, but if I press the space bar after running the command to invoke it again, I get the response "Unknown command "Dimaligned2". I can fix this issue by using the command-s function, which doesn't make sense to me because I thought command-s couldn't be used with the "pause" command token. My code is as follows: (defun c:dimaligned2 ( / OLDECHO) (setq OLDECHO (getvar "cmdecho")) (setvar "cmdecho" 1) (command-s "._dimaligned" pause "_perp" pause "@" pause "") (setvar "cmdecho" OLDECHO) ) My original code is: (defun c:dimaligned2 ( / OLDECHO) (setq OLDECHO (getvar "cmdecho")) (setvar "cmdecho" 1) (command "._dimaligned" pause "_perp" pause "@" pause "") (setvar "cmdecho" OLDECHO) ) Quote
hmsilva Posted October 28, 2015 Posted October 28, 2015 Hi broncos15, you have an extra 'enter' in "._dimaligned" command, try the following (defun c:dimaligned2 ( / OLDECHO) (setq OLDECHO (getvar "cmdecho")) (setvar "cmdecho" 1) (command "._dimaligned" pause "_perp" pause "@" pause) (setvar "cmdecho" OLDECHO) (princ) ) It works as expected in AC2015? I did test the code in AC2012/4/6, I don´t have AC2015... Henrique Quote
broncos15 Posted October 29, 2015 Author Posted October 29, 2015 Hi broncos15,you have an extra 'enter' in "._dimaligned" command, try the following (defun c:dimaligned2 ( / OLDECHO) (setq OLDECHO (getvar "cmdecho")) (setvar "cmdecho" 1) (command "._dimaligned" pause "_perp" pause "@" pause) (setvar "cmdecho" OLDECHO) (princ) ) It works as expected in AC2015? I did test the code in AC2012/4/6, I don´t have AC2015... Henrique That works perfectly. Man that was a stupid error by me, thanks for catching it. Quote
hmsilva Posted October 29, 2015 Posted October 29, 2015 You're welcome, broncos15 Glad you got it working. Henrique Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.