collect data input form

collect data input form

Anonymous
Not applicable
2,323 Views
2 Replies
Message 1 of 3

collect data input form

Anonymous
Not applicable

Anyone knows where to find a simple tutorial to create a Form to collect multiple inputs.
I need to get several integer inputs and one string input for my add-in.
I'm new with Programming and I'm doing it with C#.
Thank you all

0 Likes
Accepted solutions (1)
2,324 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Adm-inf,

 

Thank you for your query.

 

Your question really has nothing to do with the Revit API.

 

It is a pure C# .NET issue.

 

I assume you wish to make use of the .NET Windows Forms library?

 

If so, you should search the Internet for something like 'c# windows forms':

 

https://duckduckgo.com/?q=c%23+windows+forms&ia=web

 

There are only a few thousand tutorials on that topic out there waiting for you.

 

That said, several of the Revit SDK samples also display Windows forms to prompt the user for input, as do many of The Building Coder samples.

 

The last time I implemented anything myself to prompt the user for input via a Windows form may have been for in the subsidiary external settings command for the HoloLens escape path waypoint JSON exporter:

 

http://thebuildingcoder.typepad.com/blog/2016/09/hololens-escape-path-waypoint-json-exporter.html

 

Subsidiary external settings command

 

  • Display modal Windows form
  • Implement form validation using ErrorProvider class, Validating and Validated events
  • Store add-in option settings in XML using the .NET System.Configuration.ApplicationSettingsBase class
  • Store add-in option settings in JSON using custom solution and JavaScriptSerializer class

 

The entire add-in project including the Visual Studio solution, add-in manifest and entire source code is available from the ExportWaypointsJson GitHub repository:

 

https://github.com/jeremytammik/ExportWaypointsJson

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3

Anonymous
Not applicable

Thank you Jeremy.
That's what I meant I haven't found a basic tutorial to explain how to do forms with C# but I get it on my own. Soon I'll post here an example, in case of being useful for other users.