NEW: Welcome to the Rhino 6 version of this page! Looking for the older Rhino 5 version?

Duplicate Object

Demonstrates how to make a copy of a CRhinoObject-derived object.

C/C++

const CRhinoObject* object = ..... // some object
CRhinoObject* duplicate = object->Duplicate();
if( duplicate )
{
  if( context.m_doc.AddObject(duplicate) )
    context.m_doc.Redraw;
  else
    delete duplicate;
}