Skip to content

Commit

Permalink
BatchRvtUtil: Scripts: revit_dialog_detection.py: ignore 'Load Link' …
Browse files Browse the repository at this point in the history
…dialog (i.e. don't report it in the log output). It will go away on its own once the link is upgraded.
  • Loading branch information
DanRumery committed Mar 21, 2019
1 parent e76b579 commit 91a097a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions BatchRvtUtil/Scripts/revit_dialog_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
REVIT_DIALOG_MESSAGE_HANDLER_PREFIX = "[ REVIT DIALOG BOX HANDLER ]"

MODEL_UPGRADE_WINDOW_TITLE = "Model Upgrade"
LOAD_LINK_WINDOW_TITLE = "Load Link"
CHANGES_NOT_SAVED_TITLE = "Changes Not Saved"
CLOSE_PROJECT_WITHOUT_SAVING_TITLE = "Close Project Without Saving"
SAVE_FILE_WINDOW_TITLE = "Save File"
Expand All @@ -49,6 +50,7 @@
NO_BUTTON_TEXT = "No"
YES_BUTTON_TEXT = "Yes"
ALWAYS_LOAD_BUTTON_TEXT = "Always Load"
CANCEL_LINK_BUTTON_TEXT = "Cancel Link"
DO_NOT_SAVE_THE_PROJECT_TEXT = "Do not save the project"
RELINQUISH_ALL_ELEMENTS_AND_WORKSETS_TEXT = "Relinquish all elements and worksets"
RELINQUISH_ELEMENTS_AND_WORKSETS_TEXT = "Relinquish elements and worksets"
Expand Down Expand Up @@ -131,6 +133,14 @@ def DismissCheekyRevitDialogBoxes(revitProcessId, output_):
win32Buttons = revitDialog.Win32Buttons
if enabledDialog.WindowText == MODEL_UPGRADE_WINDOW_TITLE and len(buttons) == 0:
pass # Do nothing for model upgrade dialog box. It has no buttons and will go away on its own.
elif (
enabledDialog.WindowText == LOAD_LINK_WINDOW_TITLE
and
len(win32Buttons) == 1
and
ui_automation_util.GetButtonText(win32Buttons[0]) == CANCEL_LINK_BUTTON_TEXT
):
pass # Do nothing for this dialog box. It will go away on its own.
elif enabledDialog.WindowText == script_host_error.BATCH_RVT_ERROR_WINDOW_TITLE:
# Report dialog detection but do nothing for BatchRvt error message windows.
if not HAVE_REPORTED_BATCH_RVT_ERROR_WINDOW_DETECTION[0]:
Expand Down

0 comments on commit 91a097a

Please sign in to comment.