Edge to Edge Angle Determination

Hey,
Well i want to makea script that will go through the select polygon object and soften all the edge normals except for border edges and edges whos neighbors angle is over a 60 degree angle.

Now i know i need to go through every edge and checkfor this. But im not sure how in mel i would determine that angle or if its a border edge. I do know C++ very well so i know how to code just not sure on maya's syntax or currently available functions for what im doing. Thanks.

So far what ive come up with is,

Select all edges and store them in an array,
cycle through selecting the edges that get returned by a function function that determines weather the angle between them is within the range using the angle command and use rad_to_deg().

Then apply the soften edge stuff.

That soun about right?

How would i select all edges on the select object.

Also how wouldi determine if an edge is a border edge

Doesnt maya have this function allready? Why not look how itdoes the trick and then adapt it to your specific needs.

I do thiskind of tuff all the time, and youll be suprised to see how much of the functionality is just a few codes of mel.

polySelectConstraint

Im thinking with the right settings this function might do what im asking? Anyone agree?