-
Notifications
You must be signed in to change notification settings - Fork 3
/
startup.py
92 lines (67 loc) · 2.24 KB
/
startup.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
"""Example of IronPython script to be executed by pyRevit on extension load
The script filename must end in startup.py
To Test:
- rename file to startup.py
- reload pyRevit: pyRevit will run this script after successfully
created the DLL for the extension.
pyRevit runs the startup script in a dedicated IronPython engine and output
window. Thus the startup script is isolated and can not hurt the load process.
All errors will be printed to the dedicated output window similar to the way
errors are printed from pyRevit commands.
"""
#pylint: disable=import-error,invalid-name,broad-except,superfluous-parens
#pylint: disable=unused-import,wrong-import-position,unused-argument
#pylint: disable=missing-docstring
#import attrdict
#import attrdict
'''
import os.path as op
from pyrevit import HOST_APP, framework
from pyrevit import revit, DB, UI
from pyrevit import forms
from pyrevit import routes
'''
# add your module paths to the sys.path here
# sys.path.append(r'path/to/your/module')
#sys.path.append(r'C:\Python27\Lib\site-packages')
'''
print('Startup script execution test.')
print('\n'.join(sys.path))
'''
# test imports from same directory and exensions lib
#from attrdict import AttrDict
'''
data = attrdict.AttrMap({
'test':{
"foo" : "Miss"
},
"basic_setup_checks" : {
"area_schemes_requested" : ["Mary", "Mack"], # list of... strings ?
"area_schemes_found": ["All", "Dressed", "In", "Black"], # list of... strings?
"count_of_areas_found" : 0, # int
"area_parameters_missing" : ["With", "Silver", "Buttons"], # list of... strings?
"pdso_family_name" : "All Down Her Back", # string
"pdso_family_is_loaded" : True, # bool
"count_of_pdso_instances" : 0, # int
"pdso_parameters_missing" : ["And", "An", "Itsie", "Spider"] # list of... strings?
},
"area_checks":{},
"pdso_checks":{}
})
new_data = attrdict.AttrMap({
'test':{
"foo" : "Mr"
},
})
more_data = attrdict.AttrMap()
more_data.test.foo = "Mx"
#time test this
#data = data + new_data
#vs this
#b = data + new_data
c = data + more_data
a = attrdict.AttrMap({'foo': 'bar'})
print(a["foo"])
print (c.test.foo)
'''
#print('lib/ import works in startup.py')