Body is a generic wrapper for an ACIS body that doesn't fit strictly into Solid3d (solid volume) or Region (planar area) categories. It is often used for:
- Sheet bodies (surfaces).
- Wire bodies (3D wireframes).
- Bodies resulting from failed boolean operations or indeterminate states.
- Converting between other 3D formats.
Autodesk.AutoCAD.DatabaseServices
System.Object
└─ RXObject
└─ DBObject
└─ Entity
├─ Body
Inherits most properties from Entity.
| Property | Type | Description |
|---|---|---|
IsNull |
bool |
True if the internal ACIS pointer is null. |
| Method | Return Type | Description |
|---|---|---|
SetBody(IntPtr) |
void |
Sets the internal ACIS body pointer (Advanced). |
GetBody() |
IntPtr |
Gets the internal ACIS body pointer. |
// Bodies are rarely created directly via "new Body()".
// They usually result from modeling operations or import.
Body body = ent as Body;
if (body != null)
{
// It's a generic ACIS body
}// Sometimes detailed analysis requires treating a solid as a generic body
// This is more common in ObjectARX (C++) than .NETusing Autodesk.AutoCAD.BoundaryRepresentation;
// Use the BREP API to analyze topology
using (Brep brep = new Brep(someEntity))
{
foreach (Autodesk.AutoCAD.BoundaryRepresentation.Face face in brep.Faces)
{
// Analyze faces of the body/solid/region
}
}// Since Body is generic, it's hard to know what it is (Sheet? Wire?)
// Often checking Mass Properties or using Brep API is needed.// Imported STEP/IGES files often come in as Bodies
// Exploding them might yield Surfaces or Curves
DBObjectCollection parts = new DBObjectCollection();
body.Explode(parts);if (!body.IsNull)
{
// valid
}// Body is often used as a bridge to external kernels or legacy SAT files// A "Sheet Body" (surface) in ACIS terms is often wrapped as a Body entity in AutoCAD
// rather than a Surface entity (which is newer).- Prefer Specific Types: Use
Solid3dorSurfaceclasses if possible.Bodyis a catch-all fallback. - Brep API: To do anything useful with a
Body(measure, analyze), you usually need theAutodesk.AutoCAD.BoundaryRepresentationnamespace. - Performance: Like all ACIS wrappers, they are heavy. Dispose when done.