Revit Macros using Python vs Revit addin using Interactive python shell vs Dynamo

revit
python
dynamo

#1

Hello,

I am a beginner in Revit automation. I started leaning python a few months back. I am getting confused if python is really a good choice for Revit automation as Revit API is .net.
I started writing python scripts using interactive python shell, it works fine but sometimes there are some issues with the python wrapper. check below-
https://revitpythonwrapper.readthedocs.io/en/latest/known_issues.html
The below code from Proving Grounds got me stuck due to the wrong return types
http://wiki.theprovingground.org/revit-api-py-dividesurface

The issue with a free source python shell is the maintenance I guess.

Now I researched came to know Revit Macros works with python. As macros is inbuilt in Revit, it is more sensible but there is no debugging tools if we use python, the Step Into button is disabled while using Python.
Is there a solution to this ?

I think Dynamo is a better choice than the two above if I want to stick to python. I want to know your suggestion and inputs on this.


#2

Why force yourself into a python bubble? In my opinion, there are many benefits to using Dynamo. Others may disagree, but I’ll put my reasoning out here.

  1. Instant and periodic feedback as sequences nodes will return results in order.

  2. Large community of developers who share TONS of resources and tools, usually including source code for you to edit and repurpose as needed.

  3. Easier maintenance as each piece of code stored in a custom node only needs to be updated and tested once per release, where as each python add in you write will have to be tested individually for breaks along the way. As an example, let’s say the method for selecting all elements of category changes, and you called this method in 30 different ‘automation routines,’ in both Dynamo methods, and in python methods. Updating a single Dynamo node would fix that for you and the entire organization (assuming you can push it out). Whereas every individual Python adjustment you write will have to be updated individually, meaning you have to edit 30 individual sets of python code.

  4. Ability to leverage most Python and C content that other tools use as you can write custom python nodes, zero touch nodes, and whatever other method you so desire.

  5. Built in UI which can expand as needed (Dynamo player + datashapes nodes).

  6. Easier to modify to solve the next issue you face. Another example: that graph that renumbered rooms by spline can also number parking spots, furniture, spaces, areas, and whatever else you might want by simply adjusting the graph, at a simple enough level that most users can make the adjustment with minimal guidance. If a users says ‘can you make this python based add-in renumber parking instead of rooms’ you’re more than likely going to have to do this yourself, then roll out out to them as a new add-in, or an addition to your library.

Just my two cents.


#3

Hi @JacobSmall just wanted to know if you have come across any thing that can make a ribbon button withdynamo graph and auto Run some script on revit startup.This has been my only reason I am wanting to start learning RPS.
Iam not sure if Dyno can do both of these,May be if it was free i could have tested though…:wink:


#4

I believe you have to open a document in order to launch either Dynamo or Dynamo Player. As such running a graph at startup may not be an option. No idea of Dyno browser sidesteps that problem or not, but that is where I would check first.

What is your use case?


#5

I was looking a way to have all my frequently used script to be a button on the ribbon so that everybody I share it with can use them without a lot of effort just like an add-in.

I also wanted to run some scripts on the startup, for instance, to print certain sheets and save them to a folder so that if something changed on the document it will easy to track when it was done.

It seems like dyno studio can do this but I wanted it for personal use(since it’s not free) So now I have started learning to programme in Revit python shell. If this function could come as a package in dynamo It’s all I need.


#6

Hey,

You might be aware… but if you use player it will show all the graphs in a folder in a nice friendly manner…

For the rest, this twitter was posted last Friday, very intriguing :slight_smile: @Radu_Gidei

Dynamo capabilities are going exponential…

Hope that’s of interest,

Mark


#7

There are nodes that you can point to a file/directory to open (& in the background) in Revit & then have nodes to run the desired functions, but then don’t have nodes to close it out.Thus leaving the File open, but it’s just best to just have them run in the background, then open your local file.


#8

Thanks for the link Mark, well spotted. Look out for more sneak peeks over the next few days and a launch soon :rocket: