If all you want to do is edit an existing polyline, you do not need to do anything with Block Tables or Block Table Records.
However, you DO need to open the polyline itself for write. You can do this by opening it for write, or by opening it for read and using UpgradeOpen(). And as with all interactions with the drawing database, you must use a transaction for this.
The following two code snippets are identical. The oId is an object ID, such as one returned by Editor.GetSelection(). This code simply insert a point to the beginning of the selected polyline, so that it now starts at (0,0).
using (Transaction tr = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction())
{
Polyline p = tr.GetObject(oId, OpenMode.ForWrite, false) as Polyline;
if (p != null)
{
p.AddVertexAt(0, new Point2d(), 0, 0, 0);
}
tr.Commit();
}
using (Transaction tr = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction())
{
Polyline p = tr.GetObject(oId, OpenMode.ForRead, false) as Polyline;
if (p != null)
{
p.UpgradeOpen();
p.AddVertexAt(0, new Point2d(), 0, 0, 0);
}
tr.Commit();
}