import clr
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *
dialog = TaskDialog("Header")
dialog.MainInstruction = "Hello, Revit!"
dialog.MainContent = "This sample shows how to use a Revit task dialog to communicate with the user." "The command links below open additional task dialogs with more information."
dialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink1, "View information about the Revit installation")
dialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink2, "View information about the active document")
dialog.CommonButtons = TaskDialogCommonButtons.Close;
dialog.DefaultButton = TaskDialogResult.Close;
dialog.FooterText = "<a href=\"http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=2484975 \"> Click here for the Revit API Developer Center</a>"
dialog.Show()
#Assign your output to the OUT variable.
OUT = dialog
CPython3 engine use a PythonNet bridge (for .Net) and the overloading (overload methods) in current version of PythonNet (2.5) don’t work very well, seem fix in future version (3.0)
import clr
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *
from System.Reflection import BindingFlags
dialog = TaskDialog("Header")
dialog.MainInstruction = "Hello, Revit!"
dialog.MainContent = "This sample shows how to use a Revit task dialog to communicate with the user." "The command links below open additional task dialogs with more information."
dialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink1, "View information about the Revit installation")
dialog.AddCommandLink(TaskDialogCommandLinkId.CommandLink2, "View information about the active document")
dialog.CommonButtons = TaskDialogCommonButtons.Close;
dialog.DefaultButton = TaskDialogResult.Close;
dialog.FooterText = "<a href=\"http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=2484975 \"> Click here for the Revit API Developer Center</a>"
#dialog.Show()
arguments = []
ResultDialog = clr.GetClrType(dialog.GetType()).InvokeMember("Show", BindingFlags.InvokeMethod , None, dialog, arguments)
#Assign your output to the OUT variable.
OUT = ResultDialog