How to check a dot in the closed curve.

I create a lots dot,

But I want to only put dots in a closed curve, and nothing out of the closed curve.

Please someone provide a brief example for it.

Thanks

SolidworksApi macros