def GetProjectFolderName():
    projectFolderName = None
    revitFilePath = GetRevitFilePath()
    if not str.IsNullOrWhiteSpace(revitFilePath):
        projectFolderName = path_util.GetProjectFolderNameFromRevitProjectFilePath(
            revitFilePath)
    return projectFolderName
Beispiel #2
0
def GetSnapshotFolderPath(dataExportFolderPath, revitFilePath, timestamp):
    projectFolderName = path_util.GetProjectFolderNameFromRevitProjectFilePath(
        revitFilePath)
    if projectFolderName is None:
        projectFolderName = GetUnknownProjectUniqueFolderName()
    modelName = GetRevitModelName(revitFilePath)
    snapshotFolderName = GetSnapshotFolderName(timestamp.ToLocalTime())
    snapshotFolderPath = Path.Combine(dataExportFolderPath, projectFolderName,
                                      modelName, snapshotFolderName)
    return snapshotFolderPath
Beispiel #3
0
def GetSnapshotData(sessionId, revitFilePath, snapshotStartTime,
                    snapshotEndTime, snapshotFolderPath, revitJournalFilePath,
                    snapshotError):
    projectFolderName = path_util.GetProjectFolderNameFromRevitProjectFilePath(
        revitFilePath)
    projectModelFolderPath = Path.GetDirectoryName(revitFilePath)
    modelName = snapshot_data_util.GetRevitModelName(revitFilePath)
    modelFileLastModified = path_util.GetLastWriteTimeUtc(revitFilePath)
    modelFileSize = path_util.GetFileSize(revitFilePath)
    modelRevitVersion = revit_file_util.GetRevitFileVersion(revitFilePath)
    modelRevitVersionDetails = snapshot_data_util.GetRevitFileVersionDetails(
        revitFilePath)

    snapshotData = {
        "projectFolderName":
        projectFolderName,
        "modelFolder":
        path_util.ExpandedFullNetworkPath(projectModelFolderPath),
        "modelName":
        modelName,
        "modelFileLastModified":
        (time_util.GetTimestampObject(modelFileLastModified)
         if modelFileLastModified is not None else None),
        "modelFileSize":
        modelFileSize,
        "modelRevitVersion":
        modelRevitVersion,
        "modelRevitVersionDetails":
        modelRevitVersionDetails,
        "snapshotStartTime": (time_util.GetTimestampObject(snapshotStartTime)
                              if snapshotStartTime is not None else None),
        "snapshotEndTime": (time_util.GetTimestampObject(snapshotEndTime)
                            if snapshotEndTime is not None else None),
        "sessionId":
        sessionId,
        "snapshotFolder":
        path_util.ExpandedFullNetworkPath(snapshotFolderPath),
        "snapshotError":
        snapshotError,
        "username":
        environment.GetUserName(),
        "machineName":
        environment.GetMachineName(),
        "gatewayAddresses":
        network_util.GetGatewayAddresses(),
        "ipAddresses":
        network_util.GetIPAddresses(),
        snapshot_data_util.SNAPSHOT_DATA__REVIT_JOURNAL_FILE:
        revitJournalFilePath
    }

    return snapshotData