Jump to content

What is CMDECHO?


RyanGC

Recommended Posts

Hi all,

 

A 10min Google search has not been able to provide me with a satisfactory explanation of what the purpose of the CMDECHO variable is for.

 

From AutoCAD help:

CMDECHO

Controls whether prompts and input are echoed during the AutoLISP command function.

 

Can anyone elaborate on this? Perhaps I am having a brain fart moment, and everything I could possibly need to know about CMDECHO is simply already there!

Link to comment
Share on other sites

This variable will allow (CMDECHO = 1) or prevent (CMDECHO = 0) display of commands prompts on AutoCAD text window.

It is used in AutoLISP routines to don’t annoy user with a cascade of strings on command prompt. See examples below:

 

 
(defun c:Test1()
(setvar "CMDECHO" 1)
(repeat 11
 (command "_LINE" '(0 0) '(1 2) '(7 4) "")
 (command "_CIRCLE" '(0 0) 5.0)
)
(princ)
)

 

vs.

 

 
(defun c:Test2()
(setvar "CMDECHO" 0)
(repeat 11
 (command "_LINE" '(0 0) '(1 2) '(7 4) "")
 (command "_CIRCLE" '(0 0) 5.0)
)
(princ)
)

 

Regards,

Link to comment
Share on other sites

This variable will allow (CMDECHO = 1) or prevent (CMDECHO = 0) display of commands prompts on AutoCAD text window.

It is used in AutoLISP routines to don’t annoy user with a cascade of strings on command prompt. See examples below:

 

 
(defun Test1()
(setvar "CMDECHO" 1)
(command "_LINE" ‘(0 0) ‘(1 2) ‘(7 4) "")
(command "_CIRCLE" ‘(0 0) 5.0)
(princ)
)

vs.

 

 
(defun Test1()
(setvar "CMDECHO" 0)
(command "_LINE" ‘(0 0) ‘(1 2) ‘(7 4) "")
(command "_CIRCLE" ‘(0 0) 5.0)
(princ)
)

Regards,

 

Excellent. Thank you.

 

This is similar to using "filedia" in a script, no?

Link to comment
Share on other sites

You're welcome!

No, FILEDIA isn't similar with CMDECHO; it with will suppress usage of dialog box for some commands and interrogate user on command prompt instead. This way you will be able to provide information to that command by code, without user interaction.

 

Regards,

Link to comment
Share on other sites

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