Solved! Go to Solution.
private void button2_Click(object sender, EventArgs e) { IEditor m_editor; m_application = ArcSceneAddin1.ArcScene.Application; edUID.Value = "esriEditor.Editor"; m_editor = m_application.FindExtensionByCLSID(edUID) as IEditor; IEditSketch3 edSketch = m_editor as IEditSketch3; int selectedvertexcount; selectedvertexcount = edSketch.SelectedVertexCount; IPointCollection4 ptColl = edSketch.Geometry as IPointCollection4; ISketchOperation2 sketchOp = new SketchOperationClass(); sketchOp.Start(m_editor); IPoint pt = ptColl.get_Point(0); if (radioButton1.Checked) { for (int i = 0; i < ptColl.PointCount; i++) { pt = ptColl.get_Point(i); IPoint pt_c = pt; pt_c.Z = height; ptColl.UpdatePoint(i, pt_c); }; //constant }; if (radioButton2.Checked) { for (int i = 0; i < ptColl.PointCount; i++) { pt = ptColl.get_Point(i); IPoint pt_c = pt; pt_c.Z += height; ptColl.UpdatePoint(i, pt_c); }; //add to current height }; sketchOp.MenuString = "height change to selected object."; edSketch.Geometry = ptColl as IGeometry; sketchOp.Finish(edSketch.Geometry.Envelope, esriSketchOperationType.esriSketchOperationVertexDeleted, pt); }
private void button2_Click(object sender, EventArgs e) { IEditor m_editor; m_application = ArcSceneAddin1.ArcScene.Application; UIDClass edUID = new UIDClass(); edUID.Value = "esriEditor.Editor"; m_editor = m_application.FindExtensionByCLSID(edUID) as IEditor; IEditSketch3 edSketch = m_editor as IEditSketch3; int selectedvertexcount; selectedvertexcount = edSketch.SelectedVertexCount; MessageBox.Show("SelectedVertexCount = " + selectedvertexcount.ToString() + "\nLastPoint.Z = " + edSketch.LastPoint.Z); edSketch.LastPoint.Z = 145; }
edSketch.LastPoint.Z = 145;not change this value...
private void button2_Click(object sender, EventArgs e) { IEditor m_editor; m_application = ArcSceneAddin1.ArcScene.Application; edUID.Value = "esriEditor.Editor"; m_editor = m_application.FindExtensionByCLSID(edUID) as IEditor; IEditSketch3 edSketch = m_editor as IEditSketch3; int selectedvertexcount; selectedvertexcount = edSketch.SelectedVertexCount; IPointCollection4 ptColl = edSketch.Geometry as IPointCollection4; ISketchOperation2 sketchOp = new SketchOperationClass(); sketchOp.Start(m_editor); IPoint pt = ptColl.get_Point(0); if (radioButton1.Checked) { for (int i = 0; i < ptColl.PointCount; i++) { pt = ptColl.get_Point(i); IPoint pt_c = pt; pt_c.Z = height; ptColl.UpdatePoint(i, pt_c); }; //constant }; if (radioButton2.Checked) { for (int i = 0; i < ptColl.PointCount; i++) { pt = ptColl.get_Point(i); IPoint pt_c = pt; pt_c.Z += height; ptColl.UpdatePoint(i, pt_c); }; //add to current height }; sketchOp.MenuString = "height change to selected object."; edSketch.Geometry = ptColl as IGeometry; sketchOp.Finish(edSketch.Geometry.Envelope, esriSketchOperationType.esriSketchOperationVertexDeleted, pt); }