Skip to content

Commit

Permalink
revit module
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcouffin committed Oct 22, 2023
1 parent 32f5fd5 commit 159f2d7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
12 changes: 7 additions & 5 deletions pyrevitlib/pyrevit/revit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,13 @@ class ErrorSwallower():
"""Suppresses warnings during script execution.
Examples:
>>> with ErrorSwallower() as swallower:
>>> for fam in families:
>>> revit.doc.EditFamily(fam)
>>> if swallower.get_swallowed():
>>> logger.warn("Warnings swallowed")
'''python
with ErrorSwallower() as swallower:
for fam in families:
revit.doc.EditFamily(fam)
if swallower.get_swallowed():
logger.warn("Warnings swallowed")
'''
"""

def __init__(self, log_errors=True):
Expand Down
16 changes: 10 additions & 6 deletions pyrevitlib/pyrevit/revit/serverutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ def get_server_path(doc, path_dict):
path_dict (dict): dict of RSN paths and their directory paths
Examples:
>>> rsn_paths = {'RSN://SERVERNAME': '//servername/filestore'}
>>> get_server_path(doc, rsn_paths)
... "//servername/filestore/path/to/model.rvt"
'''python
rsn_paths = {'RSN://SERVERNAME': '//servername/filestore'}
get_server_path(doc, rsn_paths)
'''
"//servername/filestore/path/to/model.rvt"
"""
model_path = doc.GetWorksharingCentralModelPath()
path = DB.ModelPathUtils.ConvertModelPathToUserVisiblePath(model_path)
Expand All @@ -51,9 +53,11 @@ def get_model_sync_history(server_path):
(list[SyncHistory]): list of SyncHistory instances
Examples:
>>> get_model_sync_history("//servername/path/to/model.rvt")
... [SyncHistory(index=498, userid="user",
... timestamp="2017-12-13 19:56:20")]
'''python
get_model_sync_history("//servername/path/to/model.rvt")
'''
[SyncHistory(index=498, userid="user",
timestamp="2017-12-13 19:56:20")]
"""
db_path = server_path + MODEL_HISTORY_SQLDB
conn = sqlite3.connect(db_path)
Expand Down

0 comments on commit 159f2d7

Please sign in to comment.