Here's something I did when I was learning, hope it helps.
[CommandMethod("Arc2Poly")]
public void arc2poly()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Database db = doc.Database;
PromptSelectionOptions psOpts = new PromptSelectionOptions();
psOpts.MessageForAdding = "\nSelect arcs to convert: ";
psOpts.MessageForRemoval = "\n...Remove arcs: ";
TypedValue[] filter = { new TypedValue(0, "ARC") };
SelectionFilter ssfilter = new SelectionFilter(filter);
PromptSelectionResult psRes = ed.GetSelection(psOpts, ssfilter);
if (psRes.Status != PromptStatus.OK)
return;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
BlockTable bt = (BlockTable)db.BlockTableId.GetObject(OpenMode.ForRead);
BlockTableRecord btr = (BlockTableRecord)tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
foreach (ObjectId id in psRes.Value.GetObjectIds())
{
Arc arc = (Arc)tr.GetObject(id, OpenMode.ForWrite);
Polyline poly = new Polyline();
poly.AddVertexAt(0, new Point2d(arc.StartPoint.X, arc.StartPoint.Y), GetArcBulge(arc), 0, 0);
poly.AddVertexAt(1, new Point2d(arc.EndPoint.X, arc.EndPoint.Y), 0, 0, 0);
poly.LayerId = arc.LayerId;
btr.AppendEntity(poly);
tr.AddNewlyCreatedDBObject(poly, true);
arc.Erase();
}
tr.Commit();
}
}
private double GetArcBulge(Arc arc)
{
double deltaAng = arc.EndAngle - arc.StartAngle;
if (deltaAng < 0)
deltaAng += 2 * Math.PI;
return Math.Tan(deltaAng * 0.25);
}