You should get some inspiration from this snippet which mimics the DIVIDE command:
public void DivideCurve()
{
var doc = AcAp.DocumentManager.MdiActiveDocument;
var db = doc.Database;
var ed = doc.Editor;
using (var tr = db.TransactionManager.StartTransaction())
{
var rejectMessage = "\nCannot divide that object.";
var entityOptions = new PromptEntityOptions("\nSelect object to divide: ");
entityOptions.SetRejectMessage(rejectMessage);
entityOptions.AddAllowedClass(typeof(Curve), false);
PromptEntityResult entityResult;
Curve curve;
while (true)
{
entityResult = ed.GetEntity(entityOptions);
if (entityResult.Status != PromptStatus.OK)
return;
curve = (Curve)tr.GetObject(entityResult.ObjectId, OpenMode.ForRead);
if (curve is Xline || curve is Ray)
ed.WriteMessage(rejectMessage);
else
break;
}
var intOptions = new PromptIntegerOptions("\nEnter the number of segments: ");
intOptions.LowerLimit = 2;
intOptions.UpperLimit = 32767;
var intResult = ed.GetInteger(intOptions);
if (intResult.Status != PromptStatus.OK)
return;
var length = curve.GetDistanceAtParameter(curve.EndParam);
var numSegments = intResult.Value;
var dist = length / numSegments;
var btr = (BlockTableRecord)tr.GetObject(curve.OwnerId, OpenMode.ForWrite);
for (int i = 1; i < numSegments; i++)
{
var point = new DBPoint(curve.GetPointAtDist(i * dist));
btr.AppendEntity(point);
tr.AddNewlyCreatedDBObject(point, true);
}
tr.Commit();
}
}