Hy , I have a problem with an object "solid3d".
If I build a solid with normal
command line , the resultbuffer about it is this..
{((-1,(2129671440))(0,ACSH_HISTORY_CLASS)(330,(2129671416))(5,1E2)(100,AcDbShHistory)(90,27)(91,50)(360,(2129671432))(92,1)(280,0)(281,1))}
{((-1,(2129671432))(0,ACAD_EVALUATION_GRAPH)(330,(2129671440))(5,1E1)(100,AcDbEvalGraph)(96,1)(97,1)(91,0)(93,32)(95,1)
(360,(2129671424))(92,-1)(92,-1)(92,-1)(92,-1))}
and when I build
via code a solid the result buffer is ..
{((-1,(2129671464))(0,ACSH_HISTORY_CLASS)(330,(2129671448))(5,1E5)(100,AcDbShHistory)(90,27)(91,50)(360,(2129671456))(92,0)(280,1)(281,1))}
{((-1,(2129671456))(0,ACAD_EVALUATION_GRAPH)(330,(2129671464))(5,1E4)(100,AcDbEvalGraph)(96,0)(97,0))}
This is my code..
public static ObjectId createACube(Vector3d location, Double length)
{
Database db = HostApplicationServices.WorkingDatabase;
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
ObjectId idsolido = ObjectId.Null;
using (Transaction trans = db.TransactionManager.StartTransaction())
{
Solid3d sol = new Solid3d();
sol.CreateBox(length, length, length);
sol.RecordHistory = true;
Matrix3d mat;
mat = Matrix3d.Identity;
mat = Matrix3d.Displacement(location);
sol.TransformBy(mat);
BlockTableRecord curSpc = (BlockTableRecord)trans.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
curSpc.AppendEntity(sol);
trans.AddNewlyCreatedDBObject(sol, true);
// sol.SetDatabaseDefaults();
// sol.Material = nameWood;
sol.ShowHistory = true;
trans.Commit();
// OTHERS UTILITY FUNCTIONS.
ResultBuffer rbSolidocube = b2Editor.entGet(sol.ObjectId);
Matrix3d mcube = b2Editor.GetSolidMatrix(rbSolidocube);
idsolido = sol.ObjectId;
}
return idsolido;
}
What's my mistake ?
Thanks in advance... ! Any suggestion will be appreciated
edited by Dan: added code tags