2025.3 Class
Changes 0
C

TaskDialog

Description:
A task dialog is a dialog box that can be used to display information and receive simple input from the user. It has a common set of controls that are arranged in a standard order to assure consistent look and feel.
Remarks:

There are two ways to create and show a task dialog to the user. The first option is to construct the TaskDialog, set its properties individually, and use the instance method Show() to show it to the user. The second is to use one of the static Show() methods to construct and show the dialog in one step. When you use the static methods only a subset of the options can be specified.

Please follow Revit standards to create task dialogs. The standards are listed in the remarks of each property or method.

Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.APIObject
    Autodesk.Revit.UI.TaskDialog
public class TaskDialog : APIObject
Name Return Type Description Inherited From
C TaskDialog(String) None Creates a task dialog with title.
Name Return Type Description Inherited From
M AddCommandLink(TaskDialogCommandLinkId, String) None Adds a CommandLink associated to the given id, displaying the indicating main content.
M AddCommandLink(TaskDialogCommandLinkId, String, String) None Adds a CommandLink associated to the given id, displaying the indicating main and supporting content.
M Dispose() None Causes the object to release immediately any resources it may be utilizing. (Inherited from APIObject ) APIObject
M EnableDoNotShowAgain(String, Boolean, String) None Enables the "Do not show again" for a task dialog.
M Equals None Determines whether the specified object is equal to the current object. (Inherited from Object ) Object
M GetHashCode None Serves as the default hash function. (Inherited from Object ) Object
M GetType None Gets the Type of the current instance. (Inherited from Object ) Object
M Show() TaskDialogResult Shows the task dialog.
M Show(String, String) TaskDialogResult Shows a task dialog with title, main instruction and a Close button.
M Show(String, String, TaskDialogCommonButtons) TaskDialogResult Shows a task dialog with title, main instruction and common buttons.
M Show(String, String, TaskDialogCommonButtons, TaskDialogResult) TaskDialogResult Shows a task dialog with title, main instruction, common buttons and default buttons.
M ToString None Returns a string that represents the current object. (Inherited from Object ) Object
M WasExtraCheckBoxChecked() Boolean Gets the status of the extra checkbox.
M WasVerificationChecked() Boolean Gets the status of the verification checkbox.
Name Return Type Description Inherited From
P AllowCancellation bool Whether the task dialog can be cancelled if no cancel button is specified.
P CommonButtons TaskDialogCommonButtons The push buttons displayed in the task dialog.
P DefaultButton TaskDialogResult The default button for the dialog.
P EnableMarqueeProgressBar bool Enables a marquee style progress bar to be displayed in the TaskDialog.
P ExpandedContent string ExpandedContent is hidden by default and will display at the bottom of the task dialog when the "Show details" button is pressed.
P ExtraCheckBoxText string ExtraCheckBoxText is used to label the extra checkbox.
P FooterText string FooterText is used in the footer area of the task dialog.
P Id string The Id of the task dialog.
P IsReadOnly bool Identifies if the object is read-only or modifiable. (Inherited from APIObject ) APIObject
P MainContent string MainContent is the smaller text that appears just below the main instructions.
P MainIcon TaskDialogIcon The icon shown in the task dialog.
P MainInstruction string The large primary text that appears at the top of a task dialog.
P Title string Title of the task dialog.
P TitleAutoPrefix bool Whether the TaskDialog's title will automatically have the add-in name added as a prefix.
P VerificationText string VerificationText is used to label the verification checkbox.