I am trying to see if our features have been placed over a TerrainSurface. To do this, I need to read the geometry of the surface.
It all works, however there seems to be a units issue. The steps to reproduce are below.
1. Open drawing with TerrainSurface in. When I open the drawing it is in "US Survey Feet".
2. Run the following code. Range (and returned verticies too) returns Min X of 2560.
TerrainSurface Surface = GetFirstSurfaceFromDrawing();
DTM bentleyTerrain = Surface.DTM;
var range3d = bentleyTerrain.Range3d;
3. Change the Units of the drawing via the Utilities Ribbon to Metres.
4. Re-run the above code. The values returned are still the same.
When I look at the geometry that we are testing against, the Range / geometry changes when the units change. The surface range/ geometry does not.
Is there any way to find the insertion units of the Surface or can anyone suggest an alternative way of doing things?
My understanding is that everything in the Civil API is set\returned in meters no mater what your working units are set to. You will always need to convert input (working units to meters) & output (meters to working units) before processing.
If you look in the example code in the SDK there is a GeometryHelper class that contains methods for ConvertMasterToMeter & ConvertMeterToMaster. That class also contains many methods for formating data.
Answer Verified By: Joe H
Thank you Mike. That would match what I am seeing in the data too.