Jump to content

Recommended Posts

Posted

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)
)

Posted

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

Posted
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.

Posted

You're welcome, broncos15

Glad you got it working.

 

Henrique

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...