Get a message if the script worked without warnings

Hello

As the title suggests, I have multiple scripts that I want to be used via dynamo player, what I want is if the script has been used correctly without a problem to get a message like “done” or something, is there any node for that?

I have checked multiple packages, I think there is one from “Rhythm” called “usermessage” but I don’t know how to use it,

image

since there are only two inputs one “Refresh” (either true or false displays the message) and the user message is a string of the message is. Im not even sure if this is the correct node for the intended purpose.

please help

There is no node that can detect if a script worked, as the condition to determine success varies per script. You will need to use logic to determine the message to show.

For example, maybe the script worked if the output contains no null values. You could check for this and then use the true/false outcome in an If node to report a pass or fail message to the user message node.

2 Likes

Hello,
I don’t know if you still have it, after running the script you have a display on the player


Capture d’écran 2022-10-23 120011

Cordially
christian.stan

4 Likes

There are many ways to call pop-ups (ie: ctypes, winforms, Revit API, etc.), but as @GavinCrump indicated you will have to check the results programmatically for unexpected results. There are a LOT of possible ways to do this, and no one solution is going to be a magic bullet (ie: counting nulls won’t work if a node returns the same input object even if it a modification to the element fails, as one custom node I was working with the other day did).

Given some context on the type of outcome you’re expecting with your node we can likely help steer you towards a functional solution, as there are a great many ways to computationally validate results.

Sadly the Dynamo Player UI doesn’t discriminate between ignorable warnings (ie: geometry scaling in Civil 3D) and concerning ones (ie: family instances didn’t get created). One method you can utilize is setting the nodes which create elements to be “is output” and have the user check for concerning data types (ie: nulls), but this gets tedious as you get into really big data sets and requires training up your users (which is 100% the best way forward). For most graphs and add-ins, if users understand what the graph should have done a quick review of the model should let them know if it worked or not, and they can always hit undo at that point and seek out more help or start to modify the graph as needed for their use case.

3 Likes