# 4.14 Feedback: TaskDialogs

#### Tools Have Audiences

When a user starts using your custom scripts, they might not know when they've finished executing or whether they ran successfully. Even a small element of visual feedback can go a long way in making your tools more usable.

#### Creating a TaskDialog

[TaskDialogs](https://www.revitapidocs.com/2015/853afb57-7455-a636-9881-61a391118c16.htm) are Revit's API class for providing verbose user feedback. They can be executed with a single line of code, like so:

```python
#Boilerplate Code

TaskDialog.Show("Example Title", "Example Text")
```

Which causes Revit to display this dialog box:&#x20;

![](https://1200667159-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LqjgCN1whMnYsKXtYmV%2F-LxlavqcgZZtjf_8rdQy%2F-LxlcN9mPHqGmQKVJJSL%2FTaskDialog.JPG?alt=media\&token=d1fd63cf-52c4-45ce-a8a0-615133a07592)

TaskDialogs are useful to provide a level of feedback to a user - perhaps you want to report whether the script ran successfully or encountered any errors.

#### Customising the TaskDialog

The above example implemented a bare-minimum TaskDialog, but these can also be edited via the class' properties to make something richer, like so:

```python
#Boilerplate Code

task_dialog = TaskDialog("Example Title")
task_dialog.CommonButtons = TaskDialogCommonButtons.Cancel | TaskDialogCommonButtons.Ok | TaskDialogCommonButtons.Close |     TaskDialogCommonButtons.No | TaskDialogCommonButtons.Yes | TaskDialogCommonButtons.Retry | TaskDialogCommonButtons.None
task_dialog.FooterText = "Example Footer Text"
task_dialog.MainInstruction = "Example Main Instruction"
task_dialog.MainContent = "This is the main content for this TaskDialog"

task_dialog.Show()
```

Which display the following

![](https://1200667159-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LqjgCN1whMnYsKXtYmV%2F-LxlavqcgZZtjf_8rdQy%2F-LxlelYDWMQ5b1NrvecP%2FTaskDialog02.JPG?alt=media\&token=da2e710a-b245-4537-976d-7cf2683b64a4)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dynamopythonprimer.gitbook.io/dynamo-python-primer/4-revit-specific-topics/4.15-feedback-taskdialogs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
