IMap.FeatureSelection.Next returns null ZCoordinateUnit in the feautre geometry.

Discussion created by huangs3 on Apr 14, 2014
Latest reply on Apr 15, 2014 by Ahmed.ElSisiesrinea-esridist
xFeature is an IFeature object I retrieved by from the selected feature on the map (using IMap.FeatureSelection.Next function). The feature is from a polyline feature class in personal geodatabase (MDB). When I get into debug mode and watch the ZCoordinates units of I found null result for xFeature.Shape.SpatialReference.ZCoordinateUnit. However, I has setup the z-coordinate unit using ArcCatalog in the feature class and it was proven in debug mode watching (xFeature.Class as IGeoDataset).SpatialReference.ZCoordinateUnit. On another hand, if I use IFeatureClass.GetFeatures to retrieve the xFeature, the xFeature.Shape.SpatialReference.ZCoordinateUnit will be non-null.

======================== summary ================================================
when xFeature is obtained by IMap.FeatureSelection.Next: xFeature.Shape.SpatialReference.ZCoordinateUnit is null
when xFeature is obtained by IFeatureClass.GetFeatures : xFeature.Shape.SpatialReference.ZCoordinateUnit is not null
(xFeature.Class as IGeoDataset).SpatialReference.ZCoordinateUnit: not null, is a {System.__ComObject}
If I use ArcCatelog to view the property of the feature class, I will see non-null result.

Why does this happen? What is the best way for me to reterieve the complete feature from the map selection?

Thank you!