Hi,
Learning… Simple question.
How can I reference Brep in Rhino C++?
If I do it like this it references only a one brep face
CRhinoGetObject g;
g.SetCommandPrompt(L"Select Brep");
g.SetGeometryFilter(CRhinoGetObject::surface_object);
g.EnableSubObjectSelect();
g.GetObjects(1, 1);
if (g.CommandResult() != CRhinoCommand::success)
return g.CommandResult();
const ON_Brep* brep = g.Object(0).Brep();
if (brep == 0)
return CRhinoCommand::failure;
menno
(Menno Deij - van Rijswijk)
July 1, 2018, 9:08pm
2
You probably need to use another object type, not CRhinoGetObject::surface_object
, but something with either polysurface or brep in the name (can’t remember exactly). And you probably don’t want EnableSubObjectSelect()
.
Thanks it was polysrf_object
Do know if there is a quicker way to convert integer to ON_wString than this?
I just want to print some stuff and pass some integers.
int count = brep->m_F.Count();
auto str = std::to_string(count);
char const* strChar = str.c_str();
ON_wString strRhino (strChar);
RhinoApp().Print(strRhino);
dale
(Dale Fugier)
July 2, 2018, 5:00pm
4
There is the Rhino way:
int val = 24;
ON_wString str;
str.Format(L"%d", val);
// TODO...
– Dale