How to create a User interface in revit

Hello Everyone,

I have my dynamo script ready and I want to create a user interface. I want my user interface to look like pic below. Any ideas on how to do so?

Dynamo on its own cant achieve this.

You can either look into writing addins in C# or use a third party tool that can run scripts from buttons such as:

Pyrevit:

Nonica:

Relay:

If one of your goals here is to protect your code as well, generally not possible with dynamo scripts.

3 Likes

Hi @smrema I like Orkestra and free as well for that featureā€¦

4 Likes

Thanks for your reply @GavinCrump.

What third party tool do u recommend for someone with no coding experience but knows dynamo. I watched your old video on this issue, and you recommended dynamo browser for making a toolbar. Is it still a good option compared to these u listed?

Dyno has been phased out. I recommend pyRevit, personally.

1 Like

I recommend building your own add-in if you want your users to have an add-in feel. Leverage Dynamo Player if not.

There is a reason these are separate tools, in my experience times when you try using a hammer to drive a screw it leads to things falling apart.

4 Likes

yeah agree on that oneā€¦no matter what when its dynamo graph you will runā€¦it need close open every time and take time vs C ā€¦there are pros and cons with everythingā€¦IMO

2 Likes

Even though Dyno Browser is no longer supported, it does work up through 2024 anyway. I donā€™t know about 2025. I am creating my own add-in with C#, so probably wonā€™t ever test it in 2025.

One limitation with all avenues listed herein is, you canā€™t separate the scripts per the version of Revit. So if you have a script that only runs in 2021, you canā€™t just have that script show up in the toolbar for 2021. It will show up in every version of Revit, that you are loading your custom toolbar into. At least it was that way at one point, but I havenā€™t looked into those packages lately to see if that has changed. So you have to be methodical on how you set up your menu dropdowns and toolbars.

Also, keep deployment in mind when considering which avenue to take.

1 Like

Hi @staylor i guess with orkestra you can choice which versionā€¦but anyway it will open-close after every runā€¦i guess its faster with player, in my experienceā€¦a really nice featurein orkestra is the ā€œmediplayerā€ for loop multiple graphā€¦

2 Likes

Depending on your programming skills, IĀ“d pick either C# or Python.

The only reason I would keep my scripts in Dynamo is if you are performing many geometrical operations that can be hard to calculate with the Revit API. Dynamo offers you the possibility to debug operations while you insert nodes with a user-friendly background preview. However, when coding with pyRevit and C#, you do not have that geometry preview available.

Among C# and Python, I would choose C# over Python. In the end, Revit add-ins are created under C# by default, and pyRevit is a tool developed by a third party.

If you end up keeping your scripts in Dynamo, you should go definitely with Orkestra.

5 Likes

Hi @JMCiller yeah agreeā€¦havent tried with pyrevit, but guess its slow as well so long its a dynamo graph you will executeā€¦

Thanks @sovitek. I never looked at Orkestra, so thank you for clarifying. Iā€™m well on my way with C#, so no going back now, for me! :rofl:

1 Like

Itā€™s about as fast as running via a Python node, better than youā€™d expect but nowhere near the efficiency of C# (as well as lacking the ability to take casting shortcuts etc.).

The main benefit to pyrevit is flow control for me vs Dynamo. Being able to exit a script partway in, use builtin forms and loading bars makes for a safer experience for a user. Buttons on toolbars and a quick development experience are a plus too.

As many mentioned its a third party tool and the 2025 development has been shakey, but itā€™s a robust platform otherwise between dynamo and C#. Iā€™m learning C# currently and some things are a major drag (building wpf forms is not funā€¦) whilst others are a dream vs pyrevit.

3 Likes

The UI is much of the effort in development in any platform, but once you learn the framework it gets better. I donā€™t recommend jumping between Revit UI forms, winforms, and wpf in a day though. Thatā€™s been my experience last week and this - it really gets old quick.

A good IDE is a must though, and expertise with that IDE certainly helps.

As a tip you can also load the functions you need to test directly into Dynamo as zero touch nodes - which can allow function testing (including with the debugger) before you develop the full UI. Just be sure to set things to ā€˜publicā€™ before you build.

2 Likes

I actually am okay with the method of creating the wpf forms in C#. Once you have a couple under your belt, itā€™s not that bad, really. The fact that you can see the form as you are developing and having the controllability with naming and formatting of each element in the form separately helps greatly! I have converted about (13) of my scripts now and from the standpoint of controlling the sequence of data and not having to deal with levels and lacingā€¦sooooo much better!!

Granted, debugging is a pain. I may need to look into @jacob.small suggestion with zero touch.

The form is always going to be debugged as you are now, but the functions underneath itā€¦ :trophy:

Oh okay. Thanks for clarifying!

Luckily, other than the form code, there are certain parts of the other code that you can change and add to without having to stop and restart the debugger. If it wasnā€™t for that, would definitely be a nightmare for sure. Thank goodness for Hot Reload!!

My main bugbear is that other forms spoilt me for ages. When I realized you have to literally program things like shift select it was a reality check. Without GPT I can frankly say I would have probably given up by now.

Fallen back on winforms for now to help focus on C# syntax, got buried in wpf quirks.

1 Like

Yeah, between GPT and searching to see how others have handled certain things, I would be lost also. Especially with how to set up multiple selection checkbox list. Would have never figured that out on my own. However, even GPT gets some stuff wrong. But it does get you in the ballpark at least.

I relied on the Data-shapes package for my forms and never really got into using the others in my Dynamo scripts. So I guess, itā€™s a good thing that I donā€™t have a comparison to the wpf forms. :rofl:

Guess we are using this post as a podium, so I will digress now.

1 Like