Dynamo fails to execute parts of the definition on subsequent runs

dynamo

#1

Hey,
Me and my colleagues that are using Dynamo have noticed that it’s sometimes required to reconnect inputs or toggle a boolean back and forth to make Dynamo run when “Run” button is pressed in manual mode. Usually everything works fine the first time a dynamo script is run but upon re-running the script sometimes nothing happnes and the solver does not even start running.

My questions are:

  1. Why does this happen?
  2. Is there any way to avoid it?
  3. and is there some command I can implement in my python-scripts to “refresh” or “retoggle” the node or file?

This behaviour of Dynamo is really annoying and makes it unreliable. If there’s no current fix, I’d say that this is a major bug that needs some attention, it really lowers the usability and user experience of Dynamo.

Best

Jakob


#2

hi @jakob.lilliemarck
forcechildernseval from the prorubim package can help do that :


#3

hi @Mostafa_El_Ayoubi,
Thanks for your reply.
Do you know what API command/commans to call in IronPython to get the same functionality? I rather not make my script rely on another dynamo packages.

Best

Jakob


#4

I would have to see an example graph to know for sure, but I believe that this functionality is intentional and actually a feature rather than a bug. The usual reason for parts of a graph not running a second time is that no inputs have changed, so Dynamo doesn’t spend any time or resources re-calculating those results, and instead returns the previous values as they were stored in the RAM/scratch disk. This makes creating small portions of large graphs that use large datasets possible. Otherwise you would have to wait for five minutes to find out if the little bit of code you added at the end behaves as intended. This in fact makes graph creating and scripting easier, and creates a more reliable environment as its more stable to boot.

There are a few ways to force reruns, using packages such as the one noted below is one. I recall that reading a file (excel, CSV, etc) that has changed is another as Dynamo appears to check the path and the last modified date prior as the input consistency check. I find that the best method to do this is to use Dynamo player instead of Dynamo for Revit based stuff.

If you post an example graph and elaborate on what nodes you need to rerun and why you need them to I can try and provide more insight later today.


#5

Hi @JacobSmall
Thanks for your reply.

I must disagree, even if this is intentional it’s a temporary solution at best and should probably be assessed as of the current rather mature state of Dynamo. In manual mode one explicitly tells the solver to “RUN”, and should then be able to rely on that the script actually runs, all other outcomes would just be misleading.

If Dynamo are to make assumptions about if the graph should or shouldn’t re-run due to input changing or not, that will need to be done in a more elegant way than this. One could get inspired by Grasshopper in this regard, which works both expectedly and reliably.

For instance if i create a Python script that doesn’t take any inputs (thats the graph I have and want to run), time is one parameter that will change between the times when I press “RUN”, altough the solver will not recognize this and will not re-run the second time (unless I change some pseudo-input). The same is true also for many other occasions, such as editing a python script or wanting to re-run a batch-export script, etc.

I’ll have a look at the alternatives to force reruns.


#6

I understand where you’re coming form, but to be honest if I had to wait for Dynamo to recreate the geometry of every guard railing in order to write the script to confirm the stair meets the required egress width than I wouldn’t bother to script it. Too time consuming to write. A re-calculate all run mode would be nice in your case though. I’ll see if I can get someone’s ear to discuss this later today.

Have you considered running the graph via Dynamo player which automatically recalculates the entire graph each time you run it?