public static void ArcToPoly(this QuickTransaction tr, PromptSelectionResult psRes = null) { var psOpts = new PromptSelectionOptions(); psOpts.MessageForAdding = "\nSelect arcs to convert: "; psOpts.MessageForRemoval = "\n...Remove arcs: "; TypedValue[] filter = { new TypedValue(0, "ARC") }; var ssfilter = new SelectionFilter(filter); psRes = (psRes?.Status == PromptStatus.OK ? psRes : null) ?? tr.GetSelection(psOpts, ssfilter); if (psRes.Status != PromptStatus.OK) { return; } foreach (var id in psRes.Value.GetObjectIds()) { var arc = (Arc)tr.GetObject(id, OpenMode.ForWrite); var poly = new Polyline(); poly.AddVertexAt(0, new Point2d(arc.StartPoint.X, arc.StartPoint.Y), arc.GetArcBulge(), 0, 0); poly.AddVertexAt(1, new Point2d(arc.EndPoint.X, arc.EndPoint.Y), 0, 0, 0); poly.LayerId = arc.LayerId; tr.BlockTableRecordCurrentSpace.AppendEntity(poly); tr.AddNewlyCreatedDBObject(poly, true); arc.Erase(); } }