Dotted line

I’m trying to dynamically make a dotted line box around some thing. Making the box is simple but and I make it dotted or do I have to make a lot of little lines. I’m going for a selection box like look