running dynamo scripts on revit models without opening Revit

running dynamo scripts on revit models without opening Revit

pari_dhanakoti
Enthusiast Enthusiast
1,701 Views
3 Replies
Message 1 of 4

running dynamo scripts on revit models without opening Revit

pari_dhanakoti
Enthusiast
Enthusiast

Hi,

I am trying to run a dynamo script that attaches attributes to .rvt models. Right now the way we do is open each .rvt file individually and run the dynamo script using dynamo player. 

 

We are looking to automate this. End goal is from a .Net application I should be able to initiate a accoreconsole or somekind of process that will do the following:
1. Open revit files

2. Run the dynamo script on revit model (the dynamo script is to attach attributes to the revit file)

3. Save the revit file.

 

Simply put, the idea is to batch process a bunch of .rvt files by running a user input dynamo script on each of them without opening Revit application.

 

I know with C3D you have BatchSaveUtility (BSU) as a standalone tool. I am triggering it from accoreconsole.exe with a script file and that works for C3D models. What would be the equivalent of it for Revit?

 

If this is not possible to do via a standalone existing Autodesk tool, I am all for using APIs to achieve the same. Please point me in the direction for which Autodesk API can help with this.

0 Likes
Accepted solutions (1)
1,702 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni
Accepted solution

Please check this forum for previous discussions of this question, e.g.:

  

  

The Building Coder also discusses this repeatedly, e.g., here:

  

  

Please note that the Revit desktop end user license prohibits use of Revit as a general server application.

  

For a professional server solution for the purpose you describe with no need at all for a local Revit installation, you may also be interested in the Autodesk Platform Services APS:

   

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 4

pari_dhanakoti
Enthusiast
Enthusiast

Hi Jeremy,

Thank you for the very useful insights. If I were to use APS, would I have to look at Revit API (specifically .NET Revit SDK https://aps.autodesk.com/developer/overview/revit)?

 

Can you please clarify this for me, since I cannot find a concrete answer:

If I were to develop an application in .Net that interacts with the Revit / C3D API, the only way to make it usable for my team is publishing it as a custom add-in? The only way to access add-in will be actually opening C3D or Revit application. Is that right?

 

However, my usecase  requires not opening C3D or Revit. Run the dynamo scripts on a folder of .dwg or .rvt files without having to open C3D / Revit. Is that possible at all?

 

Another question as a followup:

Let's say, I write the .Net app and publish it as custom add-in to Revit/C3D and that this add-in will run a given dynamo script on all files in a folder of .dwg or .rvt, is it possible to make the dynamo script take user inputs. Right now the users are using dynamo player to select dyn script, give user inputs that the dyn needs and then execute it on the .dwg or .rvt that is open in C3D or Revit respectively. What will be the equivalent of it when I go through APS approach? Specifically around executing .dyn scripts and provide user inputs to .dyn script.

 

I have posted this in dynamo forum as well, but have no luck so far.

 

0 Likes
Message 4 of 4

jeremy_tammik
Alumni
Alumni

If I were to use APS, would I have to look at Revit API?

  

Yes.

  

> The only way to access add-in will be actually opening C3D or Revit application. Is that right?

  

Yes. A Revit add-in is added in to a running session of Revit.exe on the Windows desktop OS. Or, it can be modified to run in APS in the cloud on a virtual machine running a Revit engine.

  

my use case  requires not opening C3D or Revit

  

In that case, your only real option is APS.

  

What will be the equivalent of it when I go through APS approach?

   

No user input possible, you have to obtain all requied input up front and package that, e.g., in a JSON input file to be uploaded with the APS workitem.

  

> Specifically around executing .dyn scripts and provide user inputs to .dyn script.

  

I suspect the APS does not support Dynamo at this point of time. At least, that was the case a year ago:

  

  

You can rewrite the required functionality as a workitem using pure Revit API. Afaik, all Dynamo code and nodes are open source.

    

Yes, afaict, the Dynamo forum is better suited for most of these question.

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open