serverutils
Helper functions for working with revit server.
Attributes
MODEL_HISTORY_SQLDB = '/Data/Model.db3'
module-attribute
SyncHistory = namedtuple('SyncHistory', ['index', 'userid', 'timestamp'])
module-attribute
namedtuple for model sync history data in revit server
Attributes:
Name | Type | Description |
---|---|---|
index |
int
|
row index in history db |
userid |
str
|
user identifier |
timestamp |
str
|
time stamp string (e.g. "2017-12-13 19:56:20") |
Functions
get_server_path(doc, path_dict)
Return file path of a model hosted on revit server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doc |
Document
|
revit document object |
required |
path_dict |
dict
|
dict of RSN paths and their directory paths |
required |
Examples:
"//servername/filestore/path/to/model.rvt"Source code in pyrevitlib/pyrevit/revit/serverutils.py
get_model_sync_history(server_path)
Read model sync history from revit server sqlite history file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
server_path |
str
|
directory path of revit server filestore |
required |
Returns:
Type | Description |
---|---|
list[SyncHistory]
|
list of SyncHistory instances |
Examples:
[SyncHistory(index=498, userid="user", timestamp="2017-12-13 19:56:20")]