File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,14 @@ def add_handler(event_name, handler_func):
5656 create_handler (handler_func , UI .Events .ViewActivatedEventArgs )
5757 HOST_APP .uiapp .ViewActivated += event_handler
5858
59+ elif event_name == 'selection-changed' :
60+ if HOST_APP .is_older_than (2023 ):
61+ mlogger .error ("Not available in this Revit Version" )
62+ return
63+ event_handler = \
64+ create_handler (handler_func , UI .Events .SelectionChangedEventArgs )
65+ HOST_APP .uiapp .SelectionChanged += event_handler
66+
5967 return event_handler
6068
6169
@@ -72,6 +80,12 @@ def remove_handler(event_name, event_handler):
7280 elif event_name == 'view-activated' :
7381 HOST_APP .uiapp .ViewActivated -= event_handler
7482
83+ elif event_name == 'selection-changed' :
84+ if HOST_APP .is_older_than (2023 ):
85+ mlogger .error ("Not available in this Revit Version" )
86+ return
87+ HOST_APP .uiapp .SelectionChanged -= event_handler
88+
7589
7690def register_handler (event_name , handler_func , handler_group_id ):
7791 if handler_group_id not in REGISTERED_HANDLERS :
You can’t perform that action at this time.
0 commit comments