automatically run a python script in dynamo without the need to open the node and re-run the code

Hi everyone, I have just created a python script in Dynamo.
However, I need to run it again by opening the node and pressing “run” to update the data.
I would like to know if there is a possibility to run the script automatically, instead of opening the custom node and pressing “run”. Thank you to those who will answer me!!

Hi,

You can use the datashape package for that and use the forge run button

1 Like

Welcome to the community!

I assume you are talking about the “Run” button for executing the script. You can us Dynamo Player to run the script without having to open the script up in Dynamo. Using Player you can run the script consecutively and the data will update each time. If you don’t know how to use Player, there are post in the forum that cover that.

image

Good morning, thank you for your immediate feedback. I actually created a custom node within the dynamo script, using python, for it to connect to the mqtt server and read some data, which I then attribute to various instance parameters. I tried dynamo Player, which automates the run of the entire script, not just the custom node. The problem is that until I open the custom node and click run, the read is not updated. Am I doing something wrong in Dynamo Player?

thank you for your feedback, I’m not familiar with the datashape package, but I cannot figure out how to integrate it into my workflow to automate the reading of data from the mqtt broker. I would thank you very much if you could be more specific.

1 Like

can you give some guidance on this?

1 Like

Do you mean the function?

image

image

Each time you use this button the script is rerunning

2 Likes

Honestly, I have never seen a case where someone had a node just for loading those instead of incorporating them directly into the node that is actually performing a function. You might also want to set the script to manual instead of automatic.

EDIT: Incorporate a function into your code to force the node to execute when the script is ran.

run = IN[0]

if run == True:
    OUT = [doc,uiapp,app]

image

1 Like