CUI - How do you select something in a pop up in your command script?

CUI - How do you select something in a pop up in your command script?

mechrover
Explorer Explorer
441 Views
6 Replies
Message 1 of 7

CUI - How do you select something in a pop up in your command script?

mechrover
Explorer
Explorer

I made a command button in the CUI (LayoutDF) to add a layout using a template called "~~Default). 

the script is : ^C^C^R;Layout;T;~~default.dwt;^I^I^I;D;;;R;;

The idea is to add a layout, delete the Layout1, and rename the added layout.

The script works but don't want to have to click ok when the "Insert layout(s)" popup appears. I placed the tabs(^I) to try to get it to select the layout name but it still requires me to click ok. The only layout in the popup is called LAYOUT. How can I get it to select the layout and click ok, so that it moves to the next step?

 

Mechrover

 

 

 

0 Likes
442 Views
6 Replies
Replies (6)
Message 2 of 7

AVCPlugins
Advisor
Advisor

I think you need to reset the FILEDIA system variable to zero. The most important thing is not to forget to turn it back on.


Plugins for AutoCAD
A>V>C>
AppStore | Facebook | Twitter | YouTube | Blog
Message 3 of 7

mechrover
Explorer
Explorer

Ok, how do I do that and can I reset it in my script and then change it back in there as well?

0 Likes
Message 4 of 7

ВeekeeCZ
Consultant
Consultant

This works for me

 

^C^C^R-Layout;T;"acadISO -Named Plot Styles.dwt";"Layout1";

 

Note missing the first semicolon

 

BTW Are you on LT that you are willing to fight with command macros.

0 Likes
Message 5 of 7

mechrover
Explorer
Explorer

I'm not on LT

0 Likes
Message 6 of 7

Michiel.Valcke
Advisor
Advisor

@ВeekeeCZ Menu Macro's are a simple and easy way to generate custom commands. Offcourse they also have their limits. why do you consider it a 'fight' to use them? 🙂

@mechrover to follow @AVCPlugins  suggestion, just add filedia;0; at the beginning of your macro and filedia;1; at the end of your macro...

^C^Cfiledia;0; ...<your macro here> ... filedia;1;

0 Likes
Message 7 of 7

cadffm
Consultant
Consultant

Hi Mechrover,


>>"template called "~~Default"
Really a bad name for, but it is your choice to use such special characters.


>>"the script is : ^C^C^R;Layout;T;~~default.dwt;^I^I^I;D;;;R;;"
This Script is to insert a Layout by selection from a Layoutlist (more clean: ^C^C^C^R_.Layout;_template;~~default.dwt)


>>"How can I get it to select the layout and
click ok, so that it moves to the next step?"
You can't controle the dialogs by Menumacro.
You have to use another version of this command
Use command LAYOUT as you did, but do not add the ^R Control
or
use command -LAYOUT



>>"The idea is to add a layout, delete the Layout1, and rename the added layout."

^C^C^C_.Layout;_template;~~default.dwt;Layout;;_delete;LAYOUT1;;_set;LAYOUT;;_rename;LAYOUT
or
^C^C^C^R_.-Layout;_template;~~default.dwt;Layout;;_delete;LAYOUT1;;_set;LAYOUT;;_rename;LAYOUT

 

 

 

>>"I think you need to reset the FILEDIA system variable to zero. The most important thing is not to forget to turn it back on."

 

>>"suggestion, just add filedia;0; at the beginning of your macro and filedia;1; at the end of your macro..."

 

In 99.9% it doesn't make sense to set filedia in a Script, because well programmed commands uses the commandlineversion (like filedia is 0) default in automations.

As you can see in this macro: No filedia implemented, but the command don't open the standard filedialog to ask for a template file.


And in this case here(command Layout) the dialog is another one, filedia is for the standard file-dialog only.

 

Sebastian

0 Likes