TheSwamp

Code Red => .NET => Topic started by: kees987 on March 06, 2015, 09:41:55 AM

Title: Ask user input in editor
Post by: kees987 on March 06, 2015, 09:41:55 AM
In a command, i want to set some statements in my code to true or false, for example to activate a debug mode.
I cant really find how i can ask for user input during a command.
I have the code as shown below, but i am not sure how to continue from here. Could anyone push me into the right direction? thank you.
Code: [Select]
[CommandMethod("AskUserTrueFalse")]
        public void AskUserTrueFalse()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;

            //add promptoptions and add a true/false option
            PromptSelectionOptions promptOptions = new PromptSelectionOptions();
            promptOptions.Keywords.Add("True");
            promptOptions.Keywords.Add("False");

            string keywords = promptOptions.Keywords.GetDisplayString(true);
            promptOptions.MessageForAdding = "adding" + keywords;
            promptOptions.MessageForRemoval = "removing" + keywords;
        }
Title: Re: Ask user input in editor
Post by: Keith Brown on March 06, 2015, 09:49:51 AM
This should help.


http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-DF40DD82-FD27-43C5-B7D2-E75646B2E47E (http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-DF40DD82-FD27-43C5-B7D2-E75646B2E47E)



Title: Re: Ask user input in editor
Post by: kees987 on March 09, 2015, 02:36:21 AM
This should help.


http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-DF40DD82-FD27-43C5-B7D2-E75646B2E47E (http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-DF40DD82-FD27-43C5-B7D2-E75646B2E47E)

Thank you! No idea how i could have overlooked the help  :-o