You may have more luck asking a specific question rather than hoping someone will write your program for you.
Have a try yourself first and then post a question when you get stuck - you may get further than you think!
To get you started, you need to loop through all features and sub-features in the feature tree to get the sketches.
The API help has a sample: Traverse Subfeatures Example (VBA)
Use Feature.GetTypeName2 to determine the type of feature you are examining.
If it is a sketch ("ProfileFeature") then use Sketch.GetSketchSegments
Here is the example which does exactly what you want: http://help.solidworks.com/2013/English/api/sldworksapi/get_all_elements_of_sketch_example_vb.htm
It traverses the sketch and processes each element.
Artem Taturevych, Application Engineer at Intercad (Australia)
translationXpert – add-in to translate SolidWorks models
myIntercad – an integrated tool for SolidWorks Professionals