[Connect C# Update 11] Coordinate System DgnGCS.LatLongFromCartesian() giving wrong coordinates

I am getting two different values from microstations "Export Google Earth File" tool which produces a kml file for the DGN elements and from the DgnGCS.LatLongFromCartesian method.

The KML file contains everything mapped out in the correct lat long.. the LatLongFromCartesian method is giving values off by about 100 meters..

See image: https://imgur.com/a/mkvdtIB

This is not just happening with the ACS coordinates, just using it as an example.

            DgnGCS cs = DgnGCS.FromModel(Session.Instance.GetActiveDgnModel(), true);
            if (cs == null)
                return;
                
            ModelInfo mInfo = Session.Instance.GetActiveDgnModel().GetModelInfo();

            double scale = mInfo.UorPerMaster;
            DPoint3d offset = mInfo.GlobalOrigin; // 0, 0, 0  No global origin.

            DPoint3d acsOriginUor;
            ACSManager.GetActive(Session.GetActiveViewport()).GetOrigin(out acsOriginUor);
            DPoint3d acsOrigin = new DPoint3d((acsOriginUor.X - offset.X) / scale, (acsOriginUor.Y - offset.Y) / scale, (acsOriginUor.Z - offset.Z) / scale);

            GeoPoint acsLatLng;
            cs.LatLongFromCartesian(out acsLatLng, acsOrigin);

            Debug.Print("ACS Lat,Long: " + acsLatLng.Latitude + "," + acsLatLng.Longitude);

Seems fine with US coordinate systems I have tried, but not with this British National Grid.

Am I missing something or is there something wrong with the LatLongFromCartesian method?

Here is the DGN:

certainty3d-my.sharepoint.com/.../ETna477Ka4RAoNSjXsvK2iwBOEgfol-yR6gUH2hFawQ7fQ

Parents Reply Children
No Data