Simple c++ BBox

hi,
which CRhinoDoc Add method should i use for adding an const ON_BoundingBox
to the context document i c++ ?
i would love to cast it in ON_Object or ON_Brep but no cast converstion work so far what i missing ? thanks

const CRhinoObjRef& obj_ref = go.Object(0);
const CRhinoObject* obj = obj_ref.Object();
if(obj)
{
const ON_BoundingBox OB = obj->BoundingBox();
//>>>> context.m_doc.Add....

Hi @JulienPoivret,

I am not sure I understand the question, Is it that you want to convert a bounding box to a Brep box? And then add the Brep box to the document?

– Dale

simply adding the ON_BoundingBox object type to the document ?

Hi @JulienPoivret,

The Rhino document does not store bounding box objects. You see, ON_BoundingBox does not inherit from ON_Geometry.

So what are you trying to do and why?

– Dale

ah ok, then maybe converting the ON_BoundingBox object into On_Brep and adding it to the doc with context.m_doc.AddBrepObject()?

what i want is select an object and get its bounding box for further boolean operation…
how to get a brep from an ON_BoundingBox object then ?
thanks for your help;

Here is a SDK sample you can review.

– Dale

thank you just wat i need :grinning:
yes work well thank you so much !