Skip to content

Instantly share code, notes, and snippets.

@johnpierson
Created February 7, 2020 13:20
Show Gist options
  • Save johnpierson/d945805995597c6243c010e3a22bdc12 to your computer and use it in GitHub Desktop.
Save johnpierson/d945805995597c6243c010e3a22bdc12 to your computer and use it in GitHub Desktop.
import clr
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *
dialogContent = "You are about to delete all Fabrication Pipework content from the model. Are you sure?"
buttons = TaskDialogCommonButtons.Yes | TaskDialogCommonButtons.No
#assigning this to a dialog result variable allows us to check what the user selected
dialogResult = TaskDialog.Show('Delete all MEP',dialogContent,buttons)
#define a return value parameter for use as an output
returnValue = False;
#if the user clicks yes, return true to continue
if dialogResult == TaskDialogResult.Yes:
returnValue = True
OUT = returnValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment