32
32
LOAD_LINK_WINDOW_TITLE = "Load Link"
33
33
CHANGES_NOT_SAVED_TITLE = "Changes Not Saved"
34
34
CLOSE_PROJECT_WITHOUT_SAVING_TITLE = "Close Project Without Saving"
35
+ CERRAR_PROYECTO_SIN_GUARDAR = "Cerrar proyecto sin guardar"
35
36
SAVE_FILE_WINDOW_TITLE = "Save File"
36
37
EDITABLE_ELEMENTS_TITLE = "Editable Elements"
37
38
AUTODESK_CUSTOMER_INVOLVEMENT_PROGRAM_TITLE = "Autodesk Customer Involvement Program"
39
+ CAMBIOS_NO_GUARDADOS_TITLE = "Cambios no guardados"
40
+ ELEMENTS_LOST_ON_IMPORT_TITLE = "Elements Lost on Import"
41
+ REFERENCIAS_TITLE = "Referencias sin resolver"
42
+ CAMBIOS_TITLE = "Cambios locales no sincronizados con archivo central"
43
+ CHANGES_TITLE = "Local Changes Not Synchronized with Central"
44
+ NWC_TITLE = "Navisworks NWC Exporter"
45
+ REVIT_TITLE = "Revit"
38
46
OPENING_WORKSETS_TITLES = [
39
47
"Worksets" ,
40
48
"Opening Worksets"
44
52
CTRLNOTIFYSINK_CLASS_NAME = "CtrlNotifySink"
45
53
BUTTON_CLASS_NAME = "Button"
46
54
STATIC_CONTROL_CLASS_NAME = "Static"
47
-
55
+ CANCELAR_BUTTON_TEXT = "Cancelar"
48
56
CLOSE_BUTTON_TEXT = "Close"
57
+ CERRAR_BUTTON_TEXT = "Cerrar"
58
+ ACEPTAR_BUTTON_TEXT = "Aceptar"
59
+ CEDER_TODO_BUTTON_TEXT = "Ceder todos los elementos y subproyectos"
60
+ CEDER_BUTTON_TEXT = "Ceder los elementos y subproyectos"
49
61
OK_BUTTON_TEXT = "OK"
62
+ IGNORAR_BUTTON_TEXT = "Ignorar y abrir el proyecto"
63
+ NO_GUARDAR_PROYECTO_BUTTON_TEXT = "No guardar el proyecto"
50
64
NO_BUTTON_TEXT = "No"
51
65
YES_BUTTON_TEXT = "Yes"
52
66
ALWAYS_LOAD_BUTTON_TEXT = "Always Load"
53
67
CANCEL_LINK_BUTTON_TEXT = "Cancel Link"
54
68
DO_NOT_SAVE_THE_PROJECT_TEXT = "Do not save the project"
69
+ CERRAR_ARCHIVO_LOCAL_BUTTON_TEXT = "Cerrar el archivo local"
70
+ CLOSE_LOCAL_FILE_BUTTON_TEXT = "Close the local file"
71
+
55
72
RELINQUISH_ALL_ELEMENTS_AND_WORKSETS_TEXT = "Relinquish all elements and worksets"
56
73
RELINQUISH_ELEMENTS_AND_WORKSETS_TEXT = "Relinquish elements and worksets"
57
74
75
+
58
76
HAVE_REPORTED_BATCH_RVT_ERROR_WINDOW_DETECTION = [False ]
59
77
60
78
@@ -75,9 +93,16 @@ def __init__(self, dialogHwnd):
75
93
76
94
def SendButtonClick (buttons , output ):
77
95
okButtons = ui_automation_util .FilterControlsByText (buttons , OK_BUTTON_TEXT )
96
+ aceptarButtons = ui_automation_util .FilterControlsByText (buttons , ACEPTAR_BUTTON_TEXT )
97
+ ignorarButtons = ui_automation_util .FilterControlsByText (buttons , IGNORAR_BUTTON_TEXT )
98
+ cederButtons = ui_automation_util .FilterControlsByText (buttons , CEDER_BUTTON_TEXT )
99
+ cerrarButtons = ui_automation_util .FilterControlsByText (buttons , CERRAR_BUTTON_TEXT )
100
+ noGuardarButtons = ui_automation_util .FilterControlsByText (buttons , NO_GUARDAR_PROYECTO_BUTTON_TEXT )
78
101
closeButtons = ui_automation_util .FilterControlsByText (buttons , CLOSE_BUTTON_TEXT )
79
102
noButtons = ui_automation_util .FilterControlsByText (buttons , NO_BUTTON_TEXT )
80
103
alwaysLoadButtons = ui_automation_util .FilterControlsByText (buttons , ALWAYS_LOAD_BUTTON_TEXT )
104
+ cerrarLocalButtons = ui_automation_util .FilterControlsByText (buttons , CERRAR_ARCHIVO_LOCAL_BUTTON_TEXT )
105
+ closeLocalButtons = ui_automation_util .FilterControlsByText (buttons , CLOSE_LOCAL_FILE_BUTTON_TEXT )
81
106
82
107
if len (okButtons ) == 1 :
83
108
targetButton = okButtons [0 ]
@@ -87,6 +112,21 @@ def SendButtonClick(buttons, output):
87
112
targetButton = noButtons [0 ]
88
113
elif len (alwaysLoadButtons ) == 1 :
89
114
targetButton = alwaysLoadButtons [0 ]
115
+ elif len (ignorarButtons ) == 1 :
116
+ targetButton = ignorarButtons [0 ]
117
+ elif len (noGuardarButtons ) == 1 :
118
+ targetButton = noGuardarButtons [0 ]
119
+ elif len (cederButtons ) == 1 :
120
+ targetButton = cederButtons [0 ]
121
+ elif len (cerrarButtons ) == 1 :
122
+ targetButton = cerrarButtons [0 ]
123
+ elif len (aceptarButtons ) == 1 :
124
+ targetButton = aceptarButtons [0 ]
125
+ elif len (cerrarLocalButtons ) == 1 :
126
+ targetButton = aceptarButtons [0 ]
127
+ elif len (closeLocalButtons ) == 1 :
128
+ targetButton = aceptarButtons [0 ]
129
+
90
130
else :
91
131
output ()
92
132
output ("WARNING: Could not find suitable button to click." )
@@ -172,6 +212,39 @@ def DismissCheekyRevitDialogBoxes(revitProcessId, output_):
172
212
output ()
173
213
output ("'" + enabledDialog .WindowText + "' dialog box detected." )
174
214
DismissRevitDialogBox (enabledDialog .WindowText , buttons , RELINQUISH_ELEMENTS_AND_WORKSETS_TEXT , output )
215
+ elif enabledDialog .WindowText == CAMBIOS_NO_GUARDADOS_TITLE and len (buttons ) == 4 :
216
+ output ()
217
+ output ("'" + enabledDialog .WindowText + "' dialog box detected." )
218
+ DismissRevitDialogBox (enabledDialog .WindowText , buttons , NO_GUARDAR_PROYECTO_BUTTON_TEXT , output )
219
+ elif enabledDialog .WindowText == CERRAR_PROYECTO_SIN_GUARDAR and len (buttons ) == 3 :
220
+ output ()
221
+ output ("'" + enabledDialog .WindowText + "' dialog box detected." )
222
+ DismissRevitDialogBox (enabledDialog .WindowText , buttons , CEDER_TODO_BUTTON_TEXT , output )
223
+ elif enabledDialog .WindowText == REFERENCIAS_TITLE and len (buttons ) == 2 :
224
+ output ()
225
+ output ("'" + enabledDialog .WindowText + "' dialog box detected." )
226
+ DismissRevitDialogBox (enabledDialog .WindowText , buttons , IGNORAR_BUTTON_TEXT , output )
227
+ elif enabledDialog .WindowText == NWC_TITLE and len (buttons ) == 1 :
228
+ output ()
229
+ output ("'" + enabledDialog .WindowText + "' dialog box detected." )
230
+ DismissRevitDialogBox (enabledDialog .WindowText , buttons , ACEPTAR_BUTTON_TEXT , output )
231
+ elif enabledDialog .WindowText == REVIT_TITLE and len (buttons ) == 1 :
232
+ output ()
233
+ output ("'" + enabledDialog .WindowText + "' dialog box detected." )
234
+ DismissRevitDialogBox (enabledDialog .WindowText , buttons , ACEPTAR_BUTTON_TEXT , output )
235
+ elif enabledDialog .WindowText == CAMBIOS_TITLE and len (buttons ) == 3 :
236
+ output ()
237
+ output ("'" + enabledDialog .WindowText + "' dialog box detected." )
238
+ DismissRevitDialogBox (enabledDialog .WindowText , buttons , CERRAR_ARCHIVO_LOCAL_BUTTON_TEXT , output )
239
+ elif enabledDialog .WindowText == CHANGES_TITLE and len (buttons ) == 3 :
240
+ output ()
241
+ output ("'" + enabledDialog .WindowText + "' dialog box detected." )
242
+ DismissRevitDialogBox (enabledDialog .WindowText , buttons , CLOSE_LOCAL_FILE_BUTTON_TEXT , output )
243
+ elif enabledDialog .WindowText == ELEMENTS_LOST_ON_IMPORT_TITLE and len (buttons ) == 1 :
244
+ output ()
245
+ output ("'" + enabledDialog .WindowText + "' dialog box detected." )
246
+ DismissRevitDialogBox (enabledDialog .WindowText , buttons , CERRAR_BUTTON_TEXT , output )
247
+ #######
175
248
elif enabledDialog .WindowText in ["Revit" , str .Empty ] and len (buttons ) == 0 and len (win32Buttons ) > 0 :
176
249
output ()
177
250
output ("'" + enabledDialog .WindowText + "' dialog box detected." )
0 commit comments