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....
dale
(Dale Fugier)
January 30, 2024, 1:28am
2
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 ?
dale
(Dale Fugier)
January 30, 2024, 1:39am
4
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;
dale
(Dale Fugier)
January 30, 2024, 1:51am
7
Here is a SDK sample you can review.
#include "stdafx.h"
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
//
// BEGIN SampleBoundingBox command
//
#pragma region SampleBoundingBox command
class CCommandSampleBoundingBox : public CRhinoCommand
{
public:
CCommandSampleBoundingBox() { m_use_cplane = false; }
~CCommandSampleBoundingBox() = default;
UUID CommandUUID() override
{
// {9C68FA5F-413A-40B9-BC49-15AB6685F986}
static const GUID SampleBoundingBoxCommand_UUID =
{ 0x9C68FA5F, 0x413A, 0x40B9, { 0xBC, 0x49, 0x15, 0xAB, 0x66, 0x85, 0xF9, 0x86 } };
This file has been truncated. show original
– Dale
thank you just wat i need
yes work well thank you so much !