<?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 User Input in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/user-input/m-p/5111706#M76476</link>
    <description>&lt;P&gt;Commands in Revit like Offset have a textbox just below the ribbon for user input. Is it possible to create a similar textbox using the Revit API? I have been&amp;nbsp;using Windows Forms with some success, but I want the textbox to stay available while multiple objects are modified, similar to how the Offset function works. Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jun 2014 20:13:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-06-23T20:13:53Z</dc:date>
    <item>
      <title>User Input</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/user-input/m-p/5111706#M76476</link>
      <description>&lt;P&gt;Commands in Revit like Offset have a textbox just below the ribbon for user input. Is it possible to create a similar textbox using the Revit API? I have been&amp;nbsp;using Windows Forms with some success, but I want the textbox to stay available while multiple objects are modified, similar to how the Offset function works. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2014 20:13:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/user-input/m-p/5111706#M76476</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-23T20:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: User Input</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/user-input/m-p/5112326#M76477</link>
      <description>&lt;P&gt;Dear Sethgover,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nope, sorry, as far as I know this is currently not covered by the Revit API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be interesting to see your current Windows Forms solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeremy&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2014 06:09:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/user-input/m-p/5112326#M76477</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2014-06-24T06:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: User Input</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/user-input/m-p/5113014#M76478</link>
      <description>&lt;P&gt;(This is my first Revit API command). I am attempting to create a command that can select multiple doors, and then number them sequentially given a starting number, in the order they were selected. I am just attaching the code that seems necessary, all this is inside the&amp;nbsp;Execute command.&amp;nbsp;I have two partially working options:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DoorFilter selDoor = new DoorFilter();&lt;/P&gt;&lt;P&gt;DoorTest.Form1 revitForm = new DoorTest.Form1();&lt;/P&gt;&lt;P&gt;revitForm.ShowDialog();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//my form is very basic, one text box and OK button&lt;/P&gt;&lt;P&gt;string input_num = revitForm.textBox1.Text;&lt;/P&gt;&lt;P&gt;int number = Convert.ToInt16(input_num);&lt;/P&gt;&lt;P&gt;string numWrite;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //this all works fine, dialog opens and number is assigned&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Solution A&lt;/P&gt;&lt;P&gt;IList&amp;lt;Reference&amp;gt; doorList = rvtUIdoc.Selection.PickObjects(ObjectType.Element, selDoor, "pick doors");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;foreach (Reference door in doorList)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;numWrite = Convert.ToString(number);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Element thisDoor = myRVTdoc.GetElement(door);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; thisDoor.get_Parameter("Mark").Set(numWrite);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; number++;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;// this does exactly what I want, except that selection order is not retained, and doors are numbered sequentially based on order of their creation&lt;/P&gt;&lt;P&gt;// I need to do more research about possibly retaining selection order with PickObjects&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Solution B&lt;/P&gt;&lt;P&gt;while (!quitToggle)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Transaction trans = new Transaction(myRVTdoc);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trans.Start("start");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reference userSelect = rvtUIdoc.Selection.PickObject(ObjectType.Element, selDoor, "pick doors");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Element pickedElem = myRVTdoc.GetElement(userSelect);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; numWrite = Convert.ToString(number);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pickedElem.get_Parameter("Mark").Set(numWrite);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trans.Commit();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; number++;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;// I know while loops should be used very sparingly, as evidenced here.&amp;nbsp;This code works great until you need to quit the command, doors are numbered as you click, but pressing escape cancels all changes. My thought was to use a key Press or click to turn the quitToggle bool to true, but&amp;nbsp;I think&amp;nbsp;the&amp;nbsp;code gets stuck in while loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using PickObject like Solution B&amp;nbsp;seems to work better, but I don't know how to loop back to this until the&amp;nbsp;command is exited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you time,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(P.S. to you and Autodesk,&amp;nbsp;overall awesome job with documentation and examples of the Revit API, all the online&amp;nbsp;material makes it quite simple for an amateur coder like myself to start writing commands. Thanks.)&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2014 13:12:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/user-input/m-p/5113014#M76478</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-06-24T13:12:59Z</dc:date>
    </item>
  </channel>
</rss>

