Message 1 of 3
Problem while modifying Solid once created.....

Not applicable
05-13-2009
02:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everyone,
i have written function which is responsible for returning solid object (Box). Once box is created i have taken one more function which is responsible for returning 'Cylinder'.
Now i wanted to subtract Cylinder from Box. But i got error "Autodesk.AutoCAD.Runtime.Exception: eWasOpenForWrite".
So i used method UpgradeOpen for Box object, still not working.
Why? Is this error because i have returning from function...........
Thanks
{code}
private Solid3d drawSolidBox(double dblLengthAlongX, double dblLengthAlongY, double dblLengthAlongZ)
{
Solid3d solidBox;
try
{
solidBox = new Solid3d();
solidBox.RecordHistory = true;
solidBox.CreateBox(dblLengthAlongX, dblLengthAlongY, dblLengthAlongZ);
}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
return null;
}
return solidBox;
}
private Solid3d drawCylinder()
{
Solid3d solidCylinder;
try
{
solidCylinder = new Solid3d();
solidCylinder.RecordHistory = true;
solidCylinder.CreateFrustum(40, 5, 5, 5);
}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
return null;
}
return solidCylinder;
}
void MainFunction()
{
Solid3d solidBox = new Solid3d();
solidBox.RecordHistory = true;
solidBox = drawSolidBox(this.dblLength, this.dblWidth, this.dblHeight);
Solid3d solidCylinder = new Solid3d();
solidCylinder = drawCylinder();
solidBox.BooleanOperation(BooleanOperationType.BoolSubtract, solidCylinder);
blockTableRecord.AppendEntity(solidCylinder);
tran.AddNewlyCreatedDBObject(solidCylinder, true);
blockTableRecord.AppendEntity(solidBox);
tran.AddNewlyCreatedDBObject(solidBox, true);
}
{code}
i have written function which is responsible for returning solid object (Box). Once box is created i have taken one more function which is responsible for returning 'Cylinder'.
Now i wanted to subtract Cylinder from Box. But i got error "Autodesk.AutoCAD.Runtime.Exception: eWasOpenForWrite".
So i used method UpgradeOpen for Box object, still not working.
Why? Is this error because i have returning from function...........
Thanks
{code}
private Solid3d drawSolidBox(double dblLengthAlongX, double dblLengthAlongY, double dblLengthAlongZ)
{
Solid3d solidBox;
try
{
solidBox = new Solid3d();
solidBox.RecordHistory = true;
solidBox.CreateBox(dblLengthAlongX, dblLengthAlongY, dblLengthAlongZ);
}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
return null;
}
return solidBox;
}
private Solid3d drawCylinder()
{
Solid3d solidCylinder;
try
{
solidCylinder = new Solid3d();
solidCylinder.RecordHistory = true;
solidCylinder.CreateFrustum(40, 5, 5, 5);
}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
return null;
}
return solidCylinder;
}
void MainFunction()
{
Solid3d solidBox = new Solid3d();
solidBox.RecordHistory = true;
solidBox = drawSolidBox(this.dblLength, this.dblWidth, this.dblHeight);
Solid3d solidCylinder = new Solid3d();
solidCylinder = drawCylinder();
solidBox.BooleanOperation(BooleanOperationType.BoolSubtract, solidCylinder);
blockTableRecord.AppendEntity(solidCylinder);
tran.AddNewlyCreatedDBObject(solidCylinder, true);
blockTableRecord.AppendEntity(solidBox);
tran.AddNewlyCreatedDBObject(solidBox, true);
}
{code}