Deselect users selection before running a script

Hey all…

I feel like this is a very simple problem but i cant really find a way to do it…

I am trying to find a way to deselect whatever a user has selected when a script starts running. When printing to PDF you can see a red crop view on the PDF if the user has selected that accidentaly while running the script. Is there a way to deselect whatever a user has selected in Revit?

I thought transaction end would do the trick but it doesnt…

@MVE1112 See if this does the trick:
image

2 Likes

Sorry for the late response, that works perfectly thank you!