<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Set a Default Answer to Editor.GetString() in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/set-a-default-answer-to-editor-getstring/m-p/5679140#M39569</link>
    <description>&lt;P&gt;Exactly what I needed, thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2015 13:33:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-06-16T13:33:42Z</dc:date>
    <item>
      <title>Set a Default Answer to Editor.GetString()</title>
      <link>https://forums.autodesk.com/t5/net-forum/set-a-default-answer-to-editor-getstring/m-p/5677604#M39566</link>
      <description>&lt;P&gt;The editor class has a method called GetString which prompts the user for a string value via AutoCAD's command prompt. I call it in this wrapper method:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public static string PromptUserForString(string message = "Enter a string: ", string defaultAnswer = "")&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return _editor.GetString("\n" + message).StringResult;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The argument message becomes the message the user sees when prompted for a string. How do I set it up so that the value of default answer is automatically set to be the answer so that if the user hits enter right away that becomes the value like in the screen shot below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" src="https://forums.autodesk.com/t5/image/serverpage/image-id/173564i884DB43E982E7189/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" title="Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So 1 is automatically typed as an answer meaning the user can either hit enter for the value of 1 or change 1 to whatever non-default answer they want&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2015 14:35:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/set-a-default-answer-to-editor-getstring/m-p/5677604#M39566</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-15T14:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set a Default Answer to Editor.GetString()</title>
      <link>https://forums.autodesk.com/t5/net-forum/set-a-default-answer-to-editor-getstring/m-p/5678101#M39567</link>
      <description>&lt;P&gt;Editor.GetString() has an overload that takes PromptStringOptions as input parameter, so that you can define your PromptStringOptions to gain more controls on how Editor.GetString() works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case, you can look at&amp;nbsp;PromptStringOptions.DefaultValue and/or PromptStringOptions.Keywords.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2015 18:57:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/set-a-default-answer-to-editor-getstring/m-p/5678101#M39567</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2015-06-15T18:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Set a Default Answer to Editor.GetString()</title>
      <link>https://forums.autodesk.com/t5/net-forum/set-a-default-answer-to-editor-getstring/m-p/5678660#M39568</link>
      <description>&lt;P&gt;Something like this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var pso = new PromptStringOptions("\nEnter a string:");&lt;BR /&gt;pso.DefaultValue = "default";&lt;BR /&gt;var psr = editor.GetString(pso);&lt;/P&gt;&lt;P&gt;if (psr.Status == PromptStatus.OK)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // do job ...&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 06:32:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/set-a-default-answer-to-editor-getstring/m-p/5678660#M39568</guid>
      <dc:creator>zrobert</dc:creator>
      <dc:date>2015-06-16T06:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Set a Default Answer to Editor.GetString()</title>
      <link>https://forums.autodesk.com/t5/net-forum/set-a-default-answer-to-editor-getstring/m-p/5679140#M39569</link>
      <description>&lt;P&gt;Exactly what I needed, thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 13:33:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/set-a-default-answer-to-editor-getstring/m-p/5679140#M39569</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-06-16T13:33:42Z</dc:date>
    </item>
  </channel>
</rss>

