Message Box instruction if parameter missing

I found some useful posts on displaying a message box, for example after running nodes, such: Display a Message Box after running nodes (Thanks)

But I wanted to display an instructional message box in some of my Dynamo Player scripts only if needed parameters were missing.

I started with the python script I found in the above link and added to it as follows. Maybe it can be done more elegantly; if so, suggestions welcome.

Example usage shown in this image:
image
Custom node here:
image

Python:
import clr
clr.AddReference(“RevitAPIUI”)
from Autodesk.Revit.UI import TaskDialog
title = IN[0]
msg = IN[1]
show = IN[2]
msgBox = TaskDialog
if show :
showit = msgBox.Show(title,msg)
else :
showit = “OK”
OUT = showit

  • Rusty

I guess I can simplify it by using the AllFalse node:

image

  • Rusty