@@ -29,26 +29,29 @@ def get_selected_elements(doc):
29
29
except :
30
30
# old method
31
31
return list (__revit__ .ActiveUIDocument .Selection .Elements )
32
+
33
+
32
34
selection = get_selected_elements (doc )
33
35
# convenience variable for first element in selection
34
36
if len (selection ):
35
37
s0 = selection [0 ]
36
38
37
- #------------------------------------------------------------------------------
39
+ # ------------------------------------------------------------------------------
38
40
import clr
39
41
from Autodesk .Revit .DB import ElementSet , ElementId
40
42
43
+
41
44
class RevitLookup (object ):
42
45
def __init__ (self , uiApplication ):
43
- '''
46
+ """
44
47
for RevitSnoop to function properly, it needs to be instantiated
45
48
with a reference to the Revit Application object.
46
- '''
49
+ """
47
50
# find the RevitLookup plugin
48
51
try :
49
- rlapp = [app for app in uiApplication .LoadedApplications
50
- if app .GetType ().Namespace == 'RevitLookup'
51
- and app .GetType ().Name == 'App' ][0 ]
52
+ rlapp = [app for app in uiApplication .LoadedApplications
53
+ if app .GetType ().Namespace == 'RevitLookup'
54
+ and app .GetType ().Name == 'App' ][0 ]
52
55
except IndexError :
53
56
self .RevitLookup = None
54
57
return
@@ -62,8 +65,8 @@ def __init__(self, uiApplication):
62
65
63
66
def lookup (self , element ):
64
67
if not self .RevitLookup :
65
- print 'RevitLookup not installed. Visit https://github.com/jeremytammik/RevitLookup to install.'
66
- return
68
+ print ( 'RevitLookup not installed. Visit https://github.com/jeremytammik/RevitLookup to install.' )
69
+ return
67
70
if isinstance (element , int ):
68
71
element = self .revit .ActiveUIDocument .Document .GetElement (ElementId (element ))
69
72
if isinstance (element , ElementId ):
@@ -75,11 +78,16 @@ def lookup(self, element):
75
78
element = elementSet
76
79
form = self .RevitLookup .Snoop .Forms .Objects (element )
77
80
form .ShowDialog ()
81
+
82
+
78
83
_revitlookup = RevitLookup (__revit__ )
84
+
85
+
79
86
def lookup (element ):
80
87
_revitlookup .lookup (element )
81
88
82
- #------------------------------------------------------------------------------
89
+ # ------------------------------------------------------------------------------
90
+
83
91
84
92
# a fix for the __window__.Close() bug introduced with the non-modal console
85
93
class WindowWrapper (object ):
@@ -91,4 +99,12 @@ def Close(self):
91
99
92
100
def __getattr__ (self , name ):
93
101
return getattr (self .win , name )
102
+
103
+ def set_font_sizes (self , size ):
104
+ self .rps_repl = self .win .Content .Children [0 ].Children [0 ].Content .Children [0 ]
105
+ self .rps_editor = self .win .Content .Children [2 ].Children [1 ].Children [0 ]
106
+ self .rps_repl .FontSize = size
107
+ self .rps_editor .FontSize = size
108
+
109
+
94
110
__window__ = WindowWrapper (__window__ )
0 commit comments