Author Topic: Ask user input in editor  (Read 1829 times)

0 Members and 1 Guest are viewing this topic.

kees987

  • Guest
Ask user input in editor
« 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;
        }

Keith Brown

  • Swamp Rat
  • Posts: 601
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

kees987

  • Guest
Re: Ask user input in editor
« Reply #2 on: March 09, 2015, 02:36:21 AM »