ArcGIS Add Map Callout, burst error: The Geometry has no Z values
Here's how to fix it:
public bool Addfeature (ESRI. ArcGIS.Geometry.IGeometry geometry,system.collections.generic.dictionary<string,object> properties) { try {ESRI. ArcGIS.Geodatabase.IFeature feature = _featurelayer.featureclass.createfeature (); int index; index = feature. Fields.findfield ("Shape"); Igeometrydef Pgeometrydef; Pgeometrydef = feature. Fields.get_field (Index). Geometrydef as Igeometrydef; if (Pgeometrydef.hasz) {Izaware Pzaware = (izaware) geometry; Pzaware.zaware = true; IZ IZ1 = (IZ) geometry; Iz1. Setconstantz (0); Set the z value to 0 IPoint point = (IPoint) geometry; Point. Z = 0; } else {Izaware Pzaware = (izaware) geometry; Pzaware.zaware = false; } if (pgeometrydef.hasm) {Imaware Pmaware = (imaware) geometry; Pmaware.maware = true; } else {Imaware Pmaware = (imaware) geometry; Pmaware.maware = false; } feature. Shape = geometry; foreach (String key in properties. Keys) {setfeatueproperty (feature, Key, Properties[key]); } feature. Store (); return true; } catch (Exception ee) {return false; } }
Burst error: The Geometry has no Z values