SOLID CREATION VIA CODE DXF CODES..MISSING?

SOLID CREATION VIA CODE DXF CODES..MISSING?

bikelink
Contributor Contributor
1,173 Views
4 Replies
Message 1 of 5

SOLID CREATION VIA CODE DXF CODES..MISSING?

bikelink
Contributor
Contributor
I try to see some property in resbuf about a solid :

this first is created with command autocad box..

{((-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))}
.....bla bla...

this one is created with code:
{((-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))}


as You can see there are a big difference... in the last row is missing this part
"(360,(2129671424))(92,-1)(92,-1)(92,-1)(92,-1))"


1) Why ?
2) where can i find a detailed reference about this codes ?
3) I need to obtain the same structure...

this is a code that i run to buil my solid3d..(just a sample)


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();
ResultBuffer rbSolidocube = b2Editor.entGet(sol.ObjectId);
Matrix3d mcube = b2Editor.GetSolidMatrix(rbSolidocube);
idsolido = sol.ObjectId;
}
return idsolido;
}


Thanks in advance guys...!!
0 Likes
1,174 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Post a drawing with both entities.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm

wrote in message news:[email protected]...
I try to see some property in resbuf about a solid :

this first is created with command autocad box..

{((-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))}
.....bla bla...

this one is created with code:
{((-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))}


as You can see there are a big difference... in the last row is missing this part
"(360,(2129671424))(92,-1)(92,-1)(92,-1)(92,-1))"


1) Why ?
2) where can i find a detailed reference about this codes ?
3) I need to obtain the same structure...

this is a code that i run to buil my solid3d..(just a sample)


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();
ResultBuffer rbSolidocube = b2Editor.entGet(sol.ObjectId);
Matrix3d mcube = b2Editor.GetSolidMatrix(rbSolidocube);
idsolido = sol.ObjectId;
}
return idsolido;
}


Thanks in advance guys...!!
0 Likes
Message 3 of 5

bikelink
Contributor
Contributor
See the file attached..
The red box builded with normal autocad command , other added to drawing via code..
Also in property they looks differents!
0 Likes
Message 4 of 5

Anonymous
Not applicable
The APIs for solid modeling objects in AutoCAD is deliberately hobbled.

The AcDb3dSolid methods that create 'primitives' actually create only the solid body, but not the information that gives it its primitive identity and properties. The only way to do that is via the creation commands.

Unfortunately, due to the way Autodesk does things (hindering the development of applications that compete with Inventor, along with many that do not), there is not much anyone can do about it.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm

wrote in message news:[email protected]...
See the file attached..
The red box builded with normal autocad command , other added to drawing via code..
Also in property they looks differents!
0 Likes
Message 5 of 5

bikelink
Contributor
Contributor
Thank You very much Mr. Tanzillo

a Question...this happens also in Mechanical Desktop ?


anyway this new isn't good for me 😞
I can't believe that Autodesk cannot release a complete library about API solids for Autocad...base, this a businnes lost.. IMHO.
0 Likes