If you are trying to create a feature and trying to set the feature.shape to the IPoint object , you may get an error "The Geometry has no Z values". In my case , part of my code looks like this
Dim ptargs As PointEventArgs = args
Dim pt As System.Drawing.Point = ptargs.ScreenPoint
Dim np as IPoint = Converter.ToMapPoint(ctx, mapServer,
mapDescription, imageDisplay, pt.X, pt.Y)
Dim geom As IGeometry
Set geom=np
1. That convert a Screen coordinate x, y to a Geometry IPoint
Public static IPoint ToMapPoint(IServerContext,IMapServer,IMapDescription,IImageDisplay,X,Y)
2. That Coverts screen coordinates to world coordinates
Public static IPoint ToMapPoint(WebMap,X,Y)
So if we want to use the IPoint object returned by ToMapPoint () in setting the shape attribute of a newly created feature , you should use the first type overloaded function above.
After that you should add the following code
IZAware zAware=np
zAware.ZAware=true;
np.Z=0.0
Adding this piece of code will remove the error ' geometry has no Z-Values'. After this you can use the IGeometry object geom to set the shape property of newly created feature like below
Dim featureClass as IFeatureClass = featureLayer.FeatureClass
Dim f as Ifeature = featureClass.CreateFeature()
f.shape = geom
I spent my whole weekend working on this .. Hope I'll find sometime for myself next weekend.. see you all tommorow folks..
GoodNight
Addy


