Find and delete duplicate entities

I am looking for a macro that can find and delete all duplicate entities in a sketch.

Thank you

SolidworksApi macros