Two work flow paths depending on user response

I have a python script, a code block, and a boolean. If the boolean (door has hardware) is true then i dialog pops up in Revit saying “HAS Hardware”. If the boolean (door has hardware) is false the dialog does not appear. This is behaving correctly. What I’m trying to do next is to have two different work flows. One for each response to each boolean (true or false). Sounds like I need an if statement but nothing I try works. Any help out there?

Thanks!

Capture

You already have everything set up. Just insert your workflow under the if or else results respectively.

Oops. I should have been more clear sorry. I don’t know python very well. I was just looking for a way to introduce a dialog box and thats what I came up with. The rest needs to be dynamo nodes. I have a complete graph but don’t want it to run unless the boolean is false.

To further clarify… If true run a workflow if false exit graph is really what I’m trying to do.

You can’t have a function as a Python input. Is that what you’re looking to do?
You might have some better luck if you wrapped your workflow into a custom node or possibly a single code block.

Doesn’t necessarily need to be python at all. It was the only way I could find to display a dialog box. Looking for a way to ask a user a T/F question and have the work flow use a series of nodes based on their answer. True do this, false do that…

Try ScopeIf. It works best inside a custom node. (Sometimes it breaks in a .dyn) ScopeIf will only execute the preceding function of the test boolean.

Thanks. Will do. Is there a way to present the user with a dialog box? Something along these lines… If boolean is true display dialog box telling the user that the command (graph) is exiting, if false will continue?

“You might have some better luck if you wrapped your workflow into a custom node or possibly a single code block.”

Hmmm… Pretty new to dynamo. Not sure how to do that.

Python or other custom nodes are options for dialog boxes. Data-Shapes and Rhythm are two good packages to start with.

I’d also highly suggest you go through the Dynamo Primer to learn these things first. It’s hard to develop a complex workflow if you don’t know the basics.

“I’d also highly suggest you go through the Dynamo Primer to learn these things first. It’s hard to develop a complex workflow if you don’t know the basics.”

Thanks. Will do. Good advice. I’ve got a lot of experience with LISP, VB, VB.NET and VBA. I’ve also had success with other dynamo graphs but need user interaction with this one.

If I understand you correctly… There’s no way to use the python script I have and run two different work flows (nodes) based on the user’s response to the dialog box that python is creating. Correct?

I would urge you to learn Python. It will make things much easier for you.

I don’t want to say it’s not possible, but it would be a lot easier to do it all within the Python node. You might be able to get it to work with a ScopeIf or you could try changing the inputs to your workflow instead of changing what gets run.

Ok. Thanks for all your time! What’s your estimate on the learning curve for Python?

Python is very user friendly. Since you have programming experience already, everything should be familiar. I would think you’d merely have to break a few old habits and get used to the new syntax. Should take hardly any time at all before you’re up and running.

Great. Thanks again!