-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGetWarnings.py
40 lines (30 loc) · 1.06 KB
/
GetWarnings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'''
GET ALL POSSIBLE FAILURE MESSAGES
'''
# dynamo version - 1.3.3
# import common language runtime
import clr
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
# Import RevitAPI
clr.AddReference("RevitAPI")
# import all classes from Revit DB
from Autodesk.Revit.DB import *
# import document manager
from RevitServices.Persistence import DocumentManager
# import transaction manager
from RevitServices.Transactions import TransactionManager
# instantiate current document and application
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
# obtain all failure message Revit.DB elements
failureDefinitions = app.GetFailureDefinitionRegistry().ListAllFailureDefinitions()
# declare a list to append descriptions to
failureDescriptions = []
# iterate through the failure definitions and append description to output
for i in failureDefinitions:
failureDescriptions.append(i.GetDescriptionText())
# return the results
OUT = failureDescriptions