Hi Andrew,
- Yes you can. Use the Graphical Element ‘Active Selection’
If the GH Definition is open you can have your script ‘Do Something’ when an item is selected.
Here i override the color of the Wall (and remove previous element overrides)
Active Selection.gh (16.0 KB)
Alternatively you use this definition as a GH Player Script that would do it as a one-off when the button is pressed.
The transactional nature of Revit requires a command to complete before the next one is started, which requires the user who is interactively scripting to plan accordingly.