Skip to content

Commit

Permalink
BatchRvtUtil: Scripts: fix session data export to account for cloud m…
Browse files Browse the repository at this point in the history
…odel descriptors.
  • Loading branch information
DanRumery committed May 10, 2020
1 parent 2caa69f commit 0a776df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 8 additions & 1 deletion BatchRvtUtil/Scripts/revit_file_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ def SafeParseGuidText(self, guidText):
parsed, guid = Guid.TryParse(guidText)
return guid if parsed else None

def GetCloudModelDescriptor(self):
return self.cloudModelDescriptor

class RevitFileInfo():
def __init__(self, revitFilePath):
self.cloudModelInfo = RevitCloudModelInfo(revitFilePath)
Expand Down Expand Up @@ -154,7 +157,11 @@ def IsFilePathTooLong(self):
return isinstance(self.pathException, PathTooLongException)

def GetFullPath(self):
return self.revitFilePath
return (
self.revitFilePath if not self.IsCloudModel()
else
self.GetRevitCloudModelInfo().GetCloudModelDescriptor()
)

def GetFileSize(self):
return path_util.GetFileSize(self.revitFilePath)
Expand Down
10 changes: 9 additions & 1 deletion BatchRvtUtil/Scripts/session_data_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ def ExportSessionData(sessionId, sessionStartTime, sessionEndTime, sessionDataFo
def GetSessionFilesData(sessionId, sessionFiles):
sessionFilesData = {
"sessionId" : sessionId,
"sessionFiles" : [path_util.ExpandedFullNetworkPath(filePath) for filePath in sessionFiles]
"sessionFiles" : [
(
path_util.ExpandedFullNetworkPath(filePath)
if Path.IsPathRooted(filePath)
# Cloud models 'paths' are not normal file paths so this accounts for that.
else filePath
)
for filePath in sessionFiles
]
}

return sessionFilesData
Expand Down

0 comments on commit 0a776df

Please sign in to comment.