Hi all, is there a way to add a message to the user “only if x happens”? I currently am using TaskDialog.show, and it is coming up no matter what. I would like a message to pop up only if say x=1 or whatever, or like only show up if I feed it a string, but not if I feed it an empty list. Something like that. Can someone point me in the right direction please?
I would do this within a Python Node, and use a If or else statement to do this
if isinstance(input, str): #do taskdialog.show else: #do something else
The Data-Shapes UI has a toggle for whether to run a UI component or not. Use that as the condition you want to trigger the message.
Thanks Brendan, could you be a little more specific, I am new to Python. Can I put an empty list into the else statement? Can I put taskdialog.show into the out put?
I would suggest you put the task where i indicated in the IF statement then it will only run if the IF statement is true, if you put it as a OUT outside of the IF statement then it will always run as before.
You can also not include the Else part if you do not want to and at the very end if you are not bothered about the python node out just add “OUT=0” on a new line at the very bottom.