AnsweredAssumed Answered

Update Point in Polyline. C#

Question asked by tmp_online on Jun 11, 2012
Latest reply on Jun 17, 2012 by tmp_online
            int hitPartIndex;             hitPartIndex = gcPolyline.GeometryCount;             hitPartIndex--;               IGeometry geometry = gcPolyline.get_Geometry(hitPartIndex);                var pointCollection = (IPointCollection4)geometry;                int indextransformPoint;               indextransformPoint = pointCollection.PointCount;               indextransformPoint--;                Double zOffset = Convert.ToDouble( textBox3.Text);                MessageBox.Show("zOffset = " + textBox3.Text);                            if (zOffset == 0 )                   return gcPolyline as IPolyline;             IPoint TestPoint;             TestPoint = pointCollection.get_Point(0);             TestPoint.X = pointCollection.get_Point(0).X;             TestPoint.Y = pointCollection.get_Point(0).Y;             TestPoint.Z = pointCollection.get_Point(0).Z + zOffset;              MessageBox.Show("test.z = " + TestPoint.Z.ToString());              var transform3D = (ITransform3D)TestPoint;             transform3D.Move3D(0, 0, zOffset);             pointCollection.UpdatePoint(indextransformPoint, TestPoint);


Here i have 2 message boxes. First: zOffset = 150. Second: test.z = 223. But in selected polyline Z-value not change, why?

Outcomes