using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
TypedValue[] acTypValAr5 = new TypedValue[1];
acTypValAr5.SetValue(new TypedValue((int)DxfCode.BlockName, "1"), 0);
SelectionFilter acSelFtr5 = new SelectionFilter(acTypValAr5);
PromptSelectionResult acSSPrompt5 = acEd.SelectAll(acSelFtr5);
if (acSSPrompt5.Status == PromptStatus.OK)
{
//acDoc.SendStringToExecute("explode ", true, false, true);
SelectionSet acSSet5 = acSSPrompt5.Value;
DBObjectCollection objs = new DBObjectCollection();
foreach (ObjectId acSSetObject5 in acSSet5.GetObjectIds())
{
//Entity ent5 = acTrans.GetObject(acSSetObject5.ObjectId, OpenMode.ForWrite) as Entity;
Entity ent5 = acSSetObject5.GetObject(OpenMode.ForWrite) as Entity;
if (ent5 is BlockReference)
{
BlockReference blkRef = (BlockReference)acTrans.GetObject(acSSetObject5, OpenMode.ForWrite);
BlockTableRecord btr2 = (BlockTableRecord)acTrans.GetObject(blkRef.BlockTableRecord, OpenMode.ForWrite);
blkRef.Explode(objs);
}
}
}
acTrans.Commit();
}