TaskDialog Bug
Description
In the Revit 2024 and Dynamo(pyton 3) environment, the Show instance method doesn't always work as expected. If you encounter a 'missing argument' type of error, try using the static method of this class instead.
Code
pyRevit#In the Revit 2024 and Dynamo environment,
#the Show() instance method doesn't always work as expected.
#If you encounter a 'missing argument' type of error,
#try using the static method of this class instead.
#
#also see https://github.com/DynamoDS/DynamoRevit/issues/3350
import sys
import clr
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *
user_choice =TaskDialog.Show("window title",
"window content (for example press yes to do any action)",
TaskDialogCommonButtons.Yes | TaskDialogCommonButtons.No);#standart pallete of buttons, see enum at api doc
if user_choice == TaskDialogResult.Yes:
#user clicked yes button