Create a macro with solidworks API

Hello,

I have lots of rectangle of sizes 2 by 4 in different sketches. Is it possible to do a macro that automatically change them in rectangles with circles at the end like in the image?

Thanks for the help

SolidworksApi macros