HI;
BUG of get Brep data.3dm (82.8 KB)
In my file, I can not get the Brep data, this is a bug or not ?
CRhinoGetObject go;
go.SetCommandPrompt(L"Select Object");
go.GetObjects(1, 1);
ON_Brep* br = const_cast<ON_Brep*>(go.Object(0).Brep());
if (br->IsValid())//can not get the Brep data
{
br->Transform(ON_Xform::TranslationTransformation(ON_zaxis * 10.0));
RhinoApp().ActiveDoc()->AddBrepObject(*br);
}
ON_NurbsSurface* nur = go.Object(0).Surface()->NurbsSurface();
if (nur->IsValid())//get NurbsSurface data is OK
{
nur->Transform(ON_Xform::TranslationTransformation(ON_xaxis * 10.0));
RhinoApp().ActiveDoc()->AddSurfaceObject(*nur);
}
ON_Brep* br_form_nur = nur->BrepForm();
if (br_form_nur->IsValid())//get NurbsSurface data is OK, but can not convert to Brep
{
br_form_nur->Transform(ON_Xform::TranslationTransformation(ON_yaxis * 10.0));
RhinoApp().ActiveDoc()->AddBrepObject(*br_form_nur);
}
RhinoApp().ActiveView()->Redraw();
return CRhinoCommand::success;