I was curious about this, since I have code which does boolean operations and I have never had this problem. So I played around with it a bit, and the difference between your code and mine is the RecordHistory option. If you remove the RecordHistory line, your code works. If the record history is important to you (for my purposes it should be false), then I played around and figured out that you must add the solids to the ModelSpace before performing the boolean operation. So this:
{code}
Solid3d sol = new Solid3d();
Solid3d sol2 = new Solid3d();
sol.RecordHistory = true;
sol.CreateBox(20, 20, 8);
sol2.CreateBox(10, 10, 10);
sol.BooleanOperation(BooleanOperationType.BoolSubtract, sol2);
ms.AppendEntity(sol);
tr.AddNewlyCreatedDBObject(sol, true);
tr.Commit();
{code}
Becomes This:
{code}
Solid3d sol = new Solid3d();
Solid3d sol2 = new Solid3d();
sol.RecordHistory = true;
sol.CreateBox(20, 20, 8);
sol2.CreateBox(10, 10, 10);
ms.AppendEntity(sol);
ms.AppendEntity(sol2);
sol.BooleanOperation(BooleanOperationType.BoolSubtract, sol2);
tr.AddNewlyCreatedDBObject(sol, true);
tr.Commit();
{code}
Dave O.