Thank you Garima,Nimesh.
But still I couldn't get it working. I'm working on ArcGIS server version:9.31 with Spatial Reference 4326 , does that support these operations?
I tried to obtain the unit of spatial reference by using [geometry.spatialReference unit] and [sketchlayer units] but it returned only "nan" which means i tried to convert angular units to linear units. The documentation is not sufficient for someone relatively new in GIS to get stuff working :(. Can you brief about the difference between AGSUnits and AGSSRUnit, any reference is much appreciated.
Documentation asks to simplify [<AGSGeometryEngine> simplifyGeometry:<geometry>], if geometry of sketchLayer is used, but the output was same.
Then I tried using [<AGSGeometryEngine> geodesicLengthOfGeometry:<geometry> inUnit:AGSSRUnitSurveyMile], this returned the length in miles 🙂 .
-Anoop