AutoCAD Civil 3D .NET API 2014 Reference document clearly lists the following on CogoPoint.Latitude and CogoPoint.Longitude –
CogoPoint.Longitude -> Gets or sets the longitude for a point, relative to the coordinate zone and the transformation settings specified for the drawing.
public:
property double Longitude {
double get ();
void set (double value);
}
CogoPoint.Latitude -> Gets or sets the latitude for a point, relative to the coordinate zone and the transformation settings specified for the drawing.
public:
property double Latitude {
double get ();
void set (double value);
}
Let’s explore this API returned results. First, we need to set an appropriate coordinate system to our drawing file. For this experiment, I have used CA-II CS code as shown in the screenshot below -
Now I will create a COGO Point in the drawing area and we will investigate it’s Latitude and Longitude values from API and in UI OPM.
Now let’s run our custom application using Civil 3D .NET API CogoPoint.Latitude and CogoPoint.Longitude. Here is the code snippet :
ObjectId pointId = points.Add(pointCoord, "My_Test_Point");
CogoPoint cgPoint = trans.GetObject(pointId, OpenMode.ForRead) as CogoPoint;
// Point Latitude and Longitude values are in Radians
ed.WriteMessage("\nPoint Lat : " + cgPoint.Latitude.ToString() + " "
+ "Point Long : " + cgPoint.Longitude.ToString());
And here is the result shown :
In the result we get decimal values whereas in the Properties window we see the values are in degree-minute-second. However the values don’t seem to match!
API returned double values are in Radians. Referring the above screenshot, if we convert the Latitude value 0.654133960948817 radians to degree we get 37.4791089757124 degree and the Longitude value 2.24952166028165 radians converts to 128.8880756575156 degree.
Hope this is useful to you!