Task dialogue

i was trying to make dialogue. i wrote the code as below. but there is some error. anybody can help me to find the mistake in my code.

import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Mechanical import *

clr.AddReference(‘RevitAPIUI’)
from Autodesk.Revit.UI import *
from Autodesk.Revit.UI.Selection import *
from Autodesk.Revit.UI import TaskDialog
clr.AddReference(‘System’)
#from System.Collections.Generic import List

clr.AddReference(‘RevitNodes’)
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference(‘RevitServices’)
import RevitServices
from RevitServices.Persistence import DocumentManager
#from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

dis = TaskDialog(“Practice”).Show(“pr”,“acdef”)

OUT = dis

image

error as below
TypeError: Expected str, got TaskDialog

td = TaskDialog(“Practice”)
td.MainIcon = TaskDialogIcon.TaskDialogIconWarning
td.Title = “My wonderful title”
OUT= td.Show()

should work like that

1 Like