One of the main issues when trying to implement Dynamo into your office workflows is the user interface. Don’t get me wrong, I love it. But not everybody does.
So, I have been seeking ways to create a user interface that would be more conventional, in order to make it easier for a larger number of people to benefit from the power of Dynamo. The recent implementation of Dynamo Player in Revit 2017.1 brought us closer to achieving this, but the user input options are still lean.
These past couple of months, I spent a lot of time getting familiar with the revit API. Unfortunately, the only dialog box it offers is the TaskDialog, which doesn’t allow much. Recently, I saw a post on twitter that showed how winforms could be created via IronPython, I found this pretty exciting. And with John Pierson’s latest addition to his Rhythms package I was convinced that it was possible, and not so complicated.
After reading about winforms, I decided to make a node that would allow the user to create multiple input dialog boxes. So far, it handles :
- Strings (which can be converted to numbers)
Edit: there has been an update with more input types! See more here .
Here is how it works :
The node takes three inputs :
- A list of input names
- A list of input types (see codification below)
- A boolean toggle to refresh
The list of input types consists of a list of strings that will define the kind of input shown in the form.
I aim to replace this by a drop down list node with the input types. It’s going to take zero touch nodes, which I’m not yet very familiar with.
UI.MultiInputForm (Data-Shapes package , code at the end of the article) will return the values input by the user in a list:
You can add as many inputs as you want!
It all – of course – gets much better when DynamoPlayer is involved:
I hope this node is useful in getting more people to accept using dynamo. It’s just trying to fill the gap until the Dev Team or another user comes up with something much better.
Feel free to comment if you have any suggestion for improvement!
Here’s the code: