Greetings. I am a colleague of Hannah, and I believe we have found a solution. The case we are concerned with is when CIMMap.ClippingMode = CustomShape, which occurs when through the UI you go to map properties, Clip Layers, and use one of the custom clipping modes. When in this mode, the CIMMap.CustomClippingShapeURI returns a string of the form:
“CIMPATH=ClipShape/61ef717a9e874218e6fcf85c78f9497e.dat”
We found this file residing under %TEMP%. Is there an API call that will assist in constructing the absolute path to this file, or can we simply rely on finding it in a consistent location under %TEMP%?
Our objective is to retrieve the custom clipping shape, and through experimentation we discovered that the contents of the file is the geometry in EsriShape binary format. The code below retrieves the geometry from the URI. Do you see any potential problems with what we're doing here? Thanks!
string path = "C:\\Temp\\61ef717a9e874218e6fcf85c78f9497e.dat";
byte[] buffer = File.ReadAllBytes(path);
EsriShapeImportFlags importFlags = EsriShapeImportFlags.esriShapeImportDefaults;
Polygon clip_poly = GeometryEngine.Instance.ImportFromEsriShape(importFlags, buffer, SpatialReferences.WGS84) as Polygon;