Hi, everyone
I am trying to create the polyline z features in geodatabase, when I crete for 2 dimensional lines, I can always use code:
IFeatureBuffer fb = featureCls.CreateFeatureBuffer();
...
fb.shape = m_polyline;
featureCursor.Insert(fb);
...
however, when deal with "polyline Z" the the above code throw exception "Item could not be found in this collection", can anyone help? thank you very much.
the codes I did looking the following:
IPointCollection zpointColl = (IPointCollection)centerline;
zawre = (IZAware)centerline;
zawre.ZAware = true;
centerline.FromPoint = startPoint;
centerline.ToPoint = EndPoint;
centerline.SpatialReference = spaRef;
az = (IZ)zawre;
az.MultiplyZs(1);
az.InterpolateZsBetween(0, 0, 0, (zpointColl.PointCount - 1)); //Polyline always one part
az.CalculateNonSimpleZs();
try
{
IFeatureBuffer fb = CenterlineClass.CreateFeatureBuffer();
fb.set_Value(fb.Fields.FindField("LineID"), pipeID);
fb.set_Value(fb.Fields.FindField("Length"), length);
//fb.Shape = centerline; // (IGeometry)az
int i = fb.Fields.FindField("shape");
fb.Shape = centerline; //This line always throw exception Item could not be found in this collection
centerLineCur.InsertFeature(fb);
}
catch (Exception ex) { MessageBox.Show(ex.Message); }