Convert Body to Solid3d

Convert Body to Solid3d

essam-salah
Advisor Advisor
549 Views
5 Replies
Message 1 of 6

Convert Body to Solid3d

essam-salah
Advisor
Advisor

Hi,

Can we convert Autodesk.Autocad.DatabaseServices.Body to Autodesk.Autocad.DatabaseServices.Solid3d. ?

 

Any help will be appreciated. 

Thanks in advance. 

 

 

0 Likes
550 Views
5 Replies
Replies (5)
Message 2 of 6

khodulieucuong
Contributor
Contributor

try { Solid3d solid = new Solid3d(); 

Entity[] boundaryEntities = new Entity[] { body };

solid.CreateSculptedSolid(boundaryEntities, new IntegerCollection());

}

0 Likes
Message 3 of 6

essam-salah
Advisor
Advisor

@khodulieucuong wrote:

try { Solid3d solid = new Solid3d(); 

Entity[] boundaryEntities = new Entity[] { body };

solid.CreateSculptedSolid(boundaryEntities, new IntegerCollection());

}


not working too.

Autodesk.AutoCAD.Runtime.Exception: eGeneralModelingFailure
at Autodesk.AutoCAD.Runtime.Interop.ThrowExceptionForErrorStatus(Int32 errorStatus)
at Autodesk.AutoCAD.DatabaseServices.Solid3d.CreateSculptedSolid(Entity[] limitingBodies, IntegerCollection limitingFlags)
...

0 Likes
Message 4 of 6

essam-salah
Advisor
Advisor

hi @_gile 

any idea !!

0 Likes
Message 5 of 6

essam-salah
Advisor
Advisor

unfortunalty couldn't solve it yet

0 Likes
Message 6 of 6

khodulieucuong
Contributor
Contributor
using Autodesk.AutoCAD.BoundaryRepresentation;
// ...
using (Brep brep = new Brep(manualBody))
{
    // If the Brep structure doesn't represent a valid solid volume, 
    // Solid3d conversion will fail.
    if (brep.GetComplex() == null) 
    {
        // It's likely a Surface or a non-solid Body
    }
}
0 Likes