Script not working in Automatic mode

Hello everyone, I have been developing a Dynamo script that, I’ll admit, is really complex.
It’s doing the following:

  • Imports data from 2 excel files;
  • Processes the data;
  • Creates a series of lines;
  • Creates structural framing elements with the locations of previously created lines;
  • Creates a series of section views and a duplicate of the 3D Model with different orientations;
  • Places the views in sheets;
  • Automatically places the views in the center of the sheet/sets the views scale;
  • Prints said sheet views into PDF files;
  • Merges PDF files into one PDF with all sheet views.

I have been running the script in Manual Mode and it works fine.
However, when I try to run the script in Automatic Mode, it gets stuck in this infinite loop of printing out the PDFs and merging them into the final PDF form.
What can be happening here?

Full .dyn script, .rvt file and Excel files used attached bellow:
bars1.xlsx (23.1 KB)
nodes1.xlsx (19.8 KB)
structureV25.dyn (518.7 KB)
Template.rvt (3.3 MB)

Any help is appreciated :slight_smile:

Hello everyone, I’m returning to this post since there was no reply.

I’d appreciate some insight on what might be causing this since I’ve not been able to figure out what’s causing this.
I don’t know if I should mention someone here but I really need help with this.

Kind regards,

Yes normally a bad idea to run a lot of task in same run…you could try set it up with orkestra “mediaplayer” and other like that

Does it work in manual mode?
Not sure why you would need that script to run automatically anyways. Are you updating the Excel data somewhere else?
If you are, some elements like the creating the sheets might be causing problem since it’s already created. You might need to also add validation before creation.

1 Like

Hello and thank you for your reply,

What you mentioned is a package, correct?

Hello and thank you for your reply,

Yes, the workflow works in manual mode as intended.
The script would need to be automatically executed because the script is being called by C# code connected to a website.
Imagine the procedure like this:

  • User enters website
  • User fills up form
  • Data contained inside the form is converted into 2 Excel sheets containing the family types, the XYZ values and the start/end points of the structural framing elements
  • Excel sheets are placed into a directory
  • Website invokes the C# code
  • C# code starts up Revit and executes Dynamo workflow

That is why I’d need the workflow in the .dyn file to run in automatic mode. From what I’m aware, it’s the only way for the task at hand

It doesn’t have to be. You can “launch” the script like the dynamo player or orkestra would do (and they both use manual setting)

Would this be inside of the C# code?
Or would this be inside of the Dynamo workflow?

I tried to follow the example in here ( Execute Dynamo Script from Revit API - Revit - Dynamo ( ) so that the C# code invoked the DYN and executed it in Manual mode but it’s not compliling. It’s firing CS0176 error.

dynamoRevit.RevitDynamoModel.OpenFileFromPath(Journal_Dynamo_Path, true);

Thank you for your help so far

No its an app like dynamoplayer with lot of option…and an option to run many graph in loop

Is excel a good format for this workflow? From what I can tell it’s only being used as a data passing file, not used by the user specifically. Maybe look into a service like speckle or consider SQL as an in between environment to access instead?

1 Like

Hello and thank you for your reply,

The user may keep the excel files for himself with all the info he introduced in an organized manner. That way there’s traceability.
Excel seems to fit the role in the best way because it can be used for all we’d need. It can be used to give the user a report of all the materials he’d need and it can be used to pass the data onto Dynamo to be used by the workflow above.

1 Like

This can be useful for other projects in the future. Thank you!
However, the question still remains: What causes the script to enter the infinite loop?

Thank you for your time

1 Like


Managed to make the C# code work, meaning the script is working in Manual mode!

Thank you all so much for the help given out.

1 Like