AutoCAD/Suppress dialog box
Expert: Bill DeShawn - 10/10/2006
QuestionThanks very much for your valuable information and quick response.
I tried this thing and working very well.
But the AutoCAD mechanical commands are not able to suppress.
for example amoptions
What to do for this type of dialog boxes?
Regards,
Vikas Salunke
-------------------------
Followup To
Question -
How to suppress the dialog box while running lisp or VBA routines in AutoCAD Mechanical?
Answer -
Vikas:
Some command dialogs are able to be suppressed, and some are not. Those that are able to be suppressed can be done so in one of two ways.
1. When a (command ... is issued you can put a - (minus sign) in front of the command.
2. (If a dialog box comes up due to a command, you can temporarily set the CMDDIA system variable to 0, and then return it to what it was after the routine is done. If the command looks for files, you will also need to do the same thing with the FILEDIA system variable.
example:
(defun routineerr (msg)
(if msg (princ msg))
(if cd (setvar "cmddia" cd))
(if fd (setvar "cmddia" fd)
(if olderr(setq *error* olderr))
(princ)
)
(defun c:routine (/ cd fd)
(setq olderr *error* *error* routinerr)
(setq cd (getvar "cmddia"))
(setvar "cmddia 0)
(setq fd (getvar "filedia"))
(setvar "filedia" 0)
(dostuff)
(domorestuff)
(setvar "cmddia" cd)
(setvar "filedia" fd)
(setq *error* olderr)
(princ)
)
Keep in touch
Bill DeShawn
http://my.sterling.net/~bdeshawn
AnswerI am an AutoCAD person - not an AutoCAD Mechanical person. AMOPTIONS does not come up when I type it it. If AMOPTIONS comes up when you type OPTIONS, try typing in .OPTIONS with a period before the command. It may be that the command was undefined and a new function has been created in its place. Perhaps if you fill me in a little better and tell me exactly when does this dialog come up and what is it that you want to see instead of the dialog that pops up when you really want something else.
Bill DeShawn
http://my.sterling.net/~bdeshawn