Measure x,y,z coordinate gives wrong Output as "-1"

Hi

I am using "measure" to get the coordinate of the point with identity "Point2@Sketch7" but as an output I am getting value as "-1" for X coordinate while actual X coordinate value is "50.023". I don't understand why this is happening, is something wrong with my code. Is the ans I am getting is something by default value?.

Plz help. 

**************************************************************************************************************************************

               boolstatus = swDoc.Extension.SelectByID2("Point2@Sketch7", "EXTSKETCHPOINT", 0, 0, 0, true, 0, null, 0);

                ModelDocExtension Extn;

                Measure MyMeasure;

                Extn = swDoc.Extension;

                MyMeasure = Extn.CreateMeasure();

                double val1;

                val1 = MyMeasure.X;

                textBox22.Text = val1.ToString();

******************************************************************************************************************************************

SolidworksApi macros