pyrevit.revit.serverutils

Helper functions for working with revit server.

class pyrevit.revit.serverutils.SyncHistory(index, userid, timestamp)

namedtuple for model sync history data in revit server

index

row index in history db

Type:int
userid

user identifier

Type:str
timestamp

time stamp string (e.g. “2017-12-13 19:56:20”)

Type:str
index

Alias for field number 0

timestamp

Alias for field number 2

userid

Alias for field number 1

pyrevit.revit.serverutils.get_model_sync_history(server_path)

Read model sync history from revit server sqlite history file.

Parameters:server_path (str) – directory path of revit server filestore
Returns:list of SyncHistory instances
Return type:list`(``SyncHistory`)

Example

>>> get_model_sync_history("//servername/path/to/model.rvt")
... [SyncHistory(index=498, userid="user",
...              timestamp="2017-12-13 19:56:20")]
pyrevit.revit.serverutils.get_server_path(doc, path_dict)

Return file path of a model hosted on revit server.

Parameters:
  • doc (Document) – revit document object
  • path_dict (dict) – dict of RSN paths and their directory paths

Example

>>> rsn_paths = {'RSN://SERVERNAME': '//servername/filestore'}
>>> get_server_path(doc, rsn_paths)
... "//servername/filestore/path/to/model.rvt"