I have some questions about your code, which can't be complete as posted, but the exception indicates something should Not be open for write but was... The only thing that makes any sense to me is if it doesn't want the cylinder open for write so you might try to DowngradeOpen on the Cylinder. I have no idea where your transaction is coming from, and unless you declared a variable somewhere with a name of "blockTableRecord", you aren't adding the objects to anything meaningful. Unless I misunderstand the desired result, you should not add the cylinder to the transaction or the "blockTableRecord".
Why? Is this error because i have returning from function..
I definitely try to avoid passing or returning opened or temporary objects, in favor of passing ObjectID's when needed and keeping the transactions succinct. However, based on the code you have shown, I don't see you breaking the rules. I did just catch the fact that you declared solidBox and solidCylinder as New solid3d in the main function, then set them equal to the return value of the two draw functions, thereby replacing one New solid3d with another and dropping the first one. You should not use the New constructor on the declaration in the main function, but just set the value equal to the return from the draw function. Then you can't set any properties on it before it is created so you take out the RecordHistory line in the main function.
this:{code}Solid3d solidBox = new Solid3d();
solidBox.RecordHistory = true;
solidBox = drawSolidBox(this.dblLength, this.dblWidth, this.dblHeight);{code}
becomes:{code}Solid3d solidBox = drawSolidBox(this.dblLength, this.dblWidth, this.dblHeight);{code}
Dave O.