I am developing a .NET desktop application using WPF and need to interact with the Dynamo library to meet a specific requirement. The goal is for Dynamo to attach attributes to a model file provided by the user. Currently, our team uses a Dynamo script to attach these attributes, but users must manually open each model file in Civil3D or Revit, run the script via Dynamo Player, and then save the file. We want to eliminate this manual process.
Instead, I aim to use the .NET tool I am building to handle this task, so users do not need to open Civil3D or Revit or interact with Dynamo Player. We plan to replace the existing Dynamo script with direct interaction with the Dynamo library within the .NET application.
How can I achieve this? Any guidance would be appreciated. For additional context, I am a .NET engineer, but Dynamo, Civil3D, and Accoreconsole are new to me, so please bear with my lack of familiarity.
Without breaking the software license, you cannot. Well at least for Revit - I cannot speak for Civil 3D. Headless Revit is not permitted, and I have only seen/heard rumors of it in three situations, two of which are internal to Autodesk. As I am not a Civil 3D expert I won’t speak to those options just yet, but I will note there is a very recent topic on bulk processing that likely will interest you. I believe this will require opening an instance of Civil 3D though. I can speak more to Revit though.
As a first alternative look into Dynamo Multi-Player by Bird Tools. It is free, and while it does require opening Revit first you can then run the Dynamo graph or graphs across a selection of models that are both locally hosted or cloud hosted.
As a second alternative, look into moving from Dynamo to an Autodesk Platform Services tool, which can be automated enough that users won’t even need to run an application; just post a file and it will run through.
As a final alternative, you can look into bulk processing via journal playback. This requires a custom built journal which opens a Revit session, opens a model, executes the graph, synch’s the model, and closes Revit. That journal can be further configured to open a sequence of models and perform the actions on each before closing Revit; this is as close to what you asked which you can get without moving to Autodesk Platform Services and cloud processing the models, but users will see Revit show up and actions taken.
In the future I am confident that you will eventually be able to run your Dynamo graphs on your models via a cloud service, but that is far enough out that you should not let it sway your decision today.
Hi Jacob,
Thank you for your detailed response. I must clarify there is no cloud service involved for my usecase. It is one of these two:
To execute the dynamo scripts on revit, C3D models without having to open the applications.
From .Net code (a desktop app not web/cloud based) use the DynamoBIM library to perform the same steps that .dyn script would have done.
In both cases the goal is to add attributes to the models via dynamo without opening Revit / C3D.
But from what you are saying, I understand that opening the apps “headless” to execute dynamo is not possible. In which case, journal playback might be something to explore.
That was understood. I included Autodesk Platform Services as it is the only licensing compliant means of ‘headless’ which I am aware of.
Note that journal automation will be a pain for users (remember this will lock up Revit while it executes and depending on what actions you’re taking it could be quite slow to process and tie up 100% of the CPU for spurts) and is EXTREMEMLY picky - installing a new add-in or update can break the playback. For reliability opening Revit and triggering execution with Bird Tools MultiPlayer is likely your best option short of the cloud.
Thank you. This was very insightful. Haven’t used journal automation before, so this is good to know.
With APS (Autodesk Platform Services) do you know what specific services would be useful to run dynamo script on revit files in a headless fashion? If I understand your original message on this topic, you are hinting about getting away from Dynamo if I were to use APS. The end goal is to attach attributes to the models. We are doing it with dynamo right now. But you are suggesting same is achievable through APS. Is that right? If yes, do you know what service is useful for it? Any help is appreciated.
Revit doesn’t have attributes, so I am guessing you mean parameters?
For APS you would need the design automation service. Moving from Dynamo to C# as the first step. Check out the APS tutorials as they have good examples to walk you through common uses. You may also want to consider some consulting services, as it can be a lot to do quickly if you aren’t familiar with the service.