Hi,
I have the problem, that I don´t want to execute some Nodes when I don´t need them. Currently, I input empty lists into the inputs, but the nodes run anyway. Some nodes the even spit out an error when the input is empty which is confusing for the user, because the Dynamoplayer shows an error which isn´t one.
I don´t really get the difference / advantage with using Datashapes UI.
I use the Datashapes UI a lot, but how does it affect the execution of the node trees? In my experience I can add a popup with a selection, but the only thing I can do then is executing the other trees anyway, but without an Input, which failes for some OOTB-Nodes, or is the datashapes package even better than I thought?
Unfortunately, that´s not exactly what I want, because Dynamo executes all Nodes, no matter what the input is.
In C# I could just put a “return” in the main function, for example when a Datashapes Popup is cancelled. In Dynamo all nodes get executed anyway which takes time and creates errors.
For example an error occures when I input an null / an empty list into an “Element.Geometry”-Node
If I could stop this tree path from executing I would be able to create clean outputs without errors, running the dynamo player.
Ah that way, my bad…
We have had the same issue with titleblocks, the family name changed with a different version. We have solved this with a Custom node.
Exactly. There is no real way to “stop” nodes from executing, but you do have a few options for avoiding warnings and errors. Passing Empty Lists is sometimes enough to avoid warnings, but you can still run into issues this way. Python is great if you can wrap everything up in a single node. The same goes for custom nodes (as @jw.vanasselt mentioned) which are usually easier to manage than a full python solution. As long as the warning/error is contained within the custom node, you shouldn’t have any issues.
A custom node wrapping the entire branch would be far easier to build (select all the nodes on a given branch, right click the workspace background, create custom node) and maintain. Remember that python will need to change to a .net implementation written in Python 3 in the coming years, and that will have to happen in every version of the graph saved everywhere it will ever be used again… while the custom node is likely to keep itself updated as nested nodes update. For a custom node you just need to deploy the code in your own package, and/ or have users get it themselves via package manager or off the network.