Message 1 of 3
Changing the z-coordinate of one of vertex in Polyline3d
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Please somebody help. Why it does not work? I have Polyline3d in AutoCAD and the target co-ordination to move one of vertex on it. But is does not work. No error, all is clear. But vertex does not move to target position. Where am i mistake? Site
private void MoveOneVertex(Polyline3d poly3d, Point3d old_pozition, Point3d new_pozition) { Document doc = AuAcApSerApp.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor edt = doc.Editor; using (var trans = db.TransactionManager.StartTransaction()) { try { //Sorting through all vertexes of polyline ObjectId[] verts = poly3d.Cast<ObjectId>().ToArray(); for (int i = 0; i < verts.Length; i++) { PolylineVertex3d vertex = trans.GetObject(verts[i], OpenMode.ForWrite) as PolylineVertex3d; if (vertex.Position == old_pozition) { vertex.Position = new_pozition; //moving vertex to new pozition } } trans.Commit(); } catch (System.Exception ex) { edt.WriteMessage("\nError encountered " + ex.Message); trans.Abort(); } } }