int hitPartIndex = 0;
hitPartIndex = gcPolyline.GeometryCount;
hitPartIndex--;
IGeometry geometry = gcPolyline.get_Geometry(hitPartIndex);
var pointCollection = (IPointCollection4)geometry;
int indextransformPoint = 1;
indextransformPoint = pointCollection.PointCount;
MessageBox.Show("indexTransformPoint = " + indextransformPoint.ToString() +
"\nhitPartIndex = " + hitPartIndex.ToString());
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(indextransformPoint);
TestPoint.X = pointCollection.get_Point(indextransformPoint).X;
TestPoint.Y = pointCollection.get_Point(indextransformPoint).Y;
TestPoint.Z = pointCollection.get_Point(indextransformPoint).Z + zOffset;
var transform3D = (ITransform3D)TestPoint;
transform3D.Move3D(0, 0, zOffset);
var newTestPoint = (IPoint)transform3D;
IZAware zAware = newTestPoint as IZAware;
zAware.ZAware = true;
pointCollection.UpdatePoint(indextransformPoint, newTestPoint);
MessageBox.Show(pointCollection.get_Point(indextransformPoint).Z.ToString());
m_application.RefreshWindow();
Doesn't work 😞 And, for example, i use IGeometryBridge:
IPoint[] array = new IPoint[1];
array[0] = newTestPoint;
IGeometryBridge testBridge = new GeometryEnvironmentClass();
//MessageBox.Show("until testBridge");
try
{
testBridge.ReplacePoints(pointCollection, 0, 1, array);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
//MessageBox.Show("after testBridge");
But here i see only Exception errors...