static void CreatePln(Polyline acPoly)
{
// Start a transaction
using (Transaction tr = Doc.TransactionManager.StartTransaction())
{
// Open the Block table for read
BlockTable acBlkTbl;
acBlkTbl = tr.GetObject(StaticVariables.SV.acDB.BlockTableId,
OpenMode.ForRead) as BlockTable;
// Open the Block table record Model space for write
BlockTableRecord acBlkTblRec;
acBlkTblRec = tr.GetObject(acBlkTbl[BlockTableRecord.ModelSpace],
OpenMode.ForWrite) as BlockTableRecord;
// Add the new object to the block table record and the transaction
acBlkTblRec.AppendEntity(acPoly);
tr.AddNewlyCreatedDBObject(acPoly, true);
tr.Commit();
}
}