Skip to content

Commit 5f6a9f7

Browse files
Merge pull request #85 from jchristel/master
Updates to python scripts
2 parents 9199f37 + 79c85f9 commit 5f6a9f7

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

BatchRvtUtil/Scripts/batch_rvt_monitor.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -340,17 +340,20 @@ def ProcessRevitFiles(batchRvtConfig, supportedRevitFileList):
340340
snapshotDataExportFolderPath = str.Empty
341341

342342
if batchRvtConfig.EnableDataExport:
343-
snapshotDataExportFolderPath = snapshot_data_util.GetSnapshotFolderPath(
343+
try:
344+
snapshotDataExportFolderPath = snapshot_data_util.GetSnapshotFolderPath(
344345
batchRvtConfig.DataExportFolderPath,
345346
revitFilePath,
346347
isCloudModel,
347348
cloudProjectId,
348349
cloudModelId,
349350
batchRvtConfig.SessionStartTime
350351
)
351-
path_util.CreateDirectory(snapshotDataExportFolderPath)
352-
snapshotDataExportFolderPaths.append(snapshotDataExportFolderPath)
353-
352+
path_util.CreateDirectory(snapshotDataExportFolderPath)
353+
snapshotDataExportFolderPaths.append(snapshotDataExportFolderPath)
354+
except Exception as ex:
355+
Output("Failed to write session data: " + str(ex))
356+
354357
scriptData = ScriptDataUtil.ScriptData()
355358
scriptData.SessionId.SetValue(batchRvtConfig.SessionId)
356359
scriptData.TaskScriptFilePath.SetValue(batchRvtConfig.ScriptFilePath)
@@ -448,16 +451,19 @@ def RunBatchRevitTasks(batchRvtConfig):
448451
Output("Revit Files for processing (" + str(supportedCount) + "):")
449452
for supportedRevitFileInfo in supportedRevitFileList:
450453
batch_rvt_monitor_util.ShowSupportedRevitFileInfo(supportedRevitFileInfo, Output)
451-
452-
if batchRvtConfig.EnableDataExport:
453-
session_data_exporter.ExportSessionFilesData(
454+
455+
try:
456+
if batchRvtConfig.EnableDataExport:
457+
session_data_exporter.ExportSessionFilesData(
454458
batchRvtConfig.SessionDataFolderPath,
455459
batchRvtConfig.SessionId,
456460
[
457461
supportedRevitFileInfo.GetRevitFileInfo().GetFullPath()
458462
for supportedRevitFileInfo in supportedRevitFileList
459463
]
460464
)
465+
except Exception as ex:
466+
Output("Failed to write session data: " + str(ex))
461467

462468
if not aborted:
463469
Output()

BatchRvtUtil/Scripts/revit_failure_handling.py

+4
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ def ProcessFailures(failuresAccessor, output, rollBackOnWarning=False):
112112
elif failureDefinition.IsResolutionApplicable(FailureResolutionType.UnlockConstraints):
113113
output()
114114
output("\t" + "WARNING: UnlockConstraints is not a valid resolution for this failure despite the definition reporting that it is an applicable resolution!")
115+
elif failure.HasResolutionOfType(FailureResolutionType.DetachElements):
116+
failure.SetCurrentResolutionType(FailureResolutionType.DetachElements)
117+
elif failure.HasResolutionOfType(FailureResolutionType.SkipElements):
118+
failure.SetCurrentResolutionType(FailureResolutionType.SkipElements)
115119
output()
116120
output("\t" + "Attempting to resolve error using resolution: " + str(failure.GetCurrentResolutionType()))
117121
failuresAccessor.ResolveFailure(failure)

0 commit comments

Comments
 (0)