Dynamo, Revit, and capability for step-based tools?

I want to use Dynamo with Revit to create tools, such as a tool that "extends columns to the base offset of a user-specified wall"
but I don’t want it to be fully automatic, I want the user to be able to select a bunch of columns, and then press a tool button, and have code prompt the user to select a target wall to extend the columns to.

So,

  1. Can dynamo make code-snippets into Revit buttons on a custom ribbon interface tab?
  2. Can dynamo prompt the user to select something, wait for them to do so, and then use the active selection for an algorithm?
  3. Can dynamo incorporate error handling (so that if the user selects the wrong element type, Revit/Dynamo displays an error message)?

Sounds like you are just getting started with Dynamo. Check out the Dynamo Primer as it has a lot of information on there that can help you out.

In Regards to your questions.

  1. You’ll need to write C#/VB with Visual Studio or equal in order to add true Revit button/Commands/Interfaces.
  2. You don’t need to build it like this, you can select your columns and wall that you want to extend all at the same time. Look into “Select Model Elements” , “Categories” and get/set parameter by name nodes
  3. You can incorporate error handling of sorts especially if you build with Python (excluding error messages like the ones u see within Revit), but for what you need to do, it’s not required to prompt the user as you can isolate the wall and columns with node logic.

Take a look through the primer and examples and that should help you get started.

Cheers,

Mattt

Thanks Matt, you are right that I am new, I will take a look at the primer
One followup question though, are there any tools to convert from Dynamo nodes to DesignScript and then convert DesignScript to some language like C#/VB that I can use for a revit command?

This has been asked previously.
Check out:
https://forum.dynamobim.com/t/how-to-convert-from-dynamo-to-c/4858

Also if you are going down this road, check out Harry’s @BoostYourBIM training on C# and Revit. I found it very useful.
https://www.udemy.com/revitapi/

Unfortunately the link in the post to that thread shows someone creating a Dynamo script, and someone creating a C# script afterwards that does the same thing, with absolutely no clues as to how the translation was accomplished, so I must conclude it was done manually, using dynamo merely as a visual guide… which is not helpful at all to someone who isn’t a C# master.

There is no easy button that I’m aware of sorry. :slight_smile:

Maybe check out a C# course to get some of the basic’s as you don’t need to be a master to create simple UI in Revit if Dynamo doesn’t have the pretty interface you are after.

Happy Coding,

Matt

Select a node and on the right click menu, pick Node to Code

Have a look at Spring Nodes. There are a few nodes in there that generate pop-up windows (Springs.List.DropDown and Springs.List.DragDropReorder) and some others that generate instructions on the lower left corner of Revit (prompting you to pick something - See Springs.SelectInRevit and Springs.SelectLinkedElements). If you dissect the Python code inside of those nodes, you can likely generate exactly what you are trying to get for #2 and #3. I have had some luck using similar methods to make Checklist pop-up windows.