How to get the gap between splines

In drawing file, I want to get the gap between splines. And then, if there is a gap between splines, i want to do 

Fit Spline. Can I do them by using API?

SolidworksApi/macros