IF Statement for Canceled Run (DataShapes)



I have a graph to check file versions and have used DataShapes to generate a UI for it. That part works great, but I want to add something other than the weird error-ish dialog that pops up when I hit cancel. Can be either a statement along the lines of “Canceled By User” or just a return to what would essentially be a zero document state. I’ve gotten an IF node and a Passthrough to work, but I’m getting both the result of the cancel button and the actual file info process and am a bit lost at this point…

How can I set the result to be either/or, rather than both?


edit: graph attached
Find RVT File Version.dyn (16.5 KB)


Will this work?

Messy but I do not have time to open dynamo.


It seems your plugging in a directory path into your input form, so you might have some troubles, but I’ll let you have a crack at it for a little while and post up my solution if you’re still having troubles.

Essentially, the above just replaces an ‘empty’ value with the canceled message.


Replace your ignore statement with somehing like this (typing from memory):

"Canceled by user":

Where canceled is the output from the ‘canceled’ port of the Datashapes UI node, and BasicFileSavedInVersion is the result of the string from array. No need for a wait for - both have to arrive before anything can be processed anyway. The output of that codeblock gets sent to a single UI message node. This is more or less what @Steven is indicating.

Also I prefer using a Python node and calling ctypes or a Revit popup for messages like this as there are many more options available that way.

I can try to post an example of this later today if you get lost attempting it yourself.


you can use scope if for this.


Thanks for all the replies - I’ll try to take a look at it tonight or tomorrow. :beers:


@Steven’s and @i.shaw’s responses both worked, although the output from the IF needed to run through a String From Array node for it to work properly.

@JacobSmall - I’d be interested in seeing a Python based solution for dissection if you have one handy. If not don’t go out of your way.

and lastly - @Michael_Kirschner2, I’ll dig into Scope If later, I didn’t even know there was such a thing, so I appreciate the heads up.

Thanks all! :beers::beers: