If you type "DIMSTYLE", Enter, the new window "Dimension style manager" will be opened.
So, I made a lisp
(defun C:DST () (command "_DIMSTYLE" ))
but if I type "DST", Enter, there's no new window ! But in CommandLine are displayed prompts such as in command "-DIMSTYLE"
And what's funny, if I type "DIMSTYLE", Enter, the new window is displayed...
What's wrong?
Is there any system variable like ATTDIA which controls how is the command displayed - in CommandLine or in a new Dialog Box?
I have the same problem with commands HATCH, BHATCH, HATCHEDIT, LAYER and PLOT.
In AutoLISP (command) functions, the default mode is to operate from the Command: prompt line rather than the dialog box [for commands that use them]. If you want the dialog box in such a command called from a (command) function, you must request it, that is, ask to initiate the dialog box immediately before the (command) function:
(initdia)
(command ....
Thank you for your gold advice. It works for:
(DEFUN C:LA () (INITDIA) (COMMAND "_LAYER"))
(DEFUN C:H () (INITDIA) (COMMAND "_HATCH"))
(DEFUN C:BH () (INITDIA) (COMMAND "_BHATCH"))
(DEFUN C:HE () (INITDIA) (COMMAND "_HATCHEDIT"))
(DEFUN C:PLO () (INITDIA) (COMMAND "_PLOT"))
What is interesting: If you type a commad with minus sign at the beginning, the contextual menu (and not a dialog box) will be opened, even if you type (INITDIA) before (COMMAND "-..."), for example:
(DEFUN C:LA1 () (INITDIA) (COMMAND "_-LAYER"))
(DEFUN C:H1 () (INITDIA) (COMMAND "_-HATCH"))
(DEFUN C:BH1 () (INITDIA) (COMMAND "_BHATCH"))
(DEFUN C:HE1 () (INITDIA) (COMMAND "_-HATCHEDIT"))
(DEFUN C:PLO1 () (INITDIA) (COMMAND "_-PLOT"))
But, there is one problem.
For the command "_DIMSTYLE", your advice does not work 😞
I typed:
(defun C:DST () (INITDIA) (command "_DIMSTYLE" ))
(defun C:DSTT () (INITDIA) (command "_-DIMSTYLE" ))
(defun C:DSTTT () (INITDIA) (command "_'DIMSTYLE" ))
And all these three commands cause, that the contextual menu is opened.
Is there some way to open command "DIMSTYLE" in the dialog box?
@damian.wrobel wrote:
...
For the command "_DIMSTYLE", your advice does not work 😞
...
Is there some way to open command "DIMSTYLE" in the dialog box?
Yes! There's an old, apparently no longer documented but still valid in 2015, command from way back before dialog boxes were the default mode for a lot of commands and there were assorted commands starting with D for the dialog-box version: DDIM. I find that:
(command "DDIM")
works, even without the preceding (initdia).
Yes, it works, thank you a lot!
So, there is no way that the DIMSTYLE command will be opened in the dialog box and therefore we are forced to use the DDIM command in the lisp, yes?
@damian.wrobel wrote:
Yes, it works, thank you a lot!
So, there is no way that the DIMSTYLE command will be opened in the dialog box and therefore we are forced to use the DDIM command in the lisp, yes?
I tried some other variants in addition to the ones you listed, and I couldn't find a way. But I wouldn't claim there isn't one....
@Kent1Cooper wrote:
@damian.wrobel wrote:
....
So, there is no way that the DIMSTYLE command will be opened in the dialog box and therefore we are forced to use the DDIM command in the lisp, yes?
I tried some other variants in addition to the ones you listed, and I couldn't find a way. But I wouldn't claim there isn't one....
However, as pendean suggested, [I didn't try but] you should try making an alias for it [and the others] in the .pgp file, since all the commands you're defining do nothing other than call up the command, anyway. I expect that would get you the dialog box, without using an old command name that may not continue to be honored in future versions.