In my plugin I add a set of point objects like this
CRhinoPointObject** point_object_array = new CRhinoPointObject*[4];
for (int i = 0; i < 4; i++) {
point_object_array[i] = new CRhinoPointObject();
point_object_array[i]->SetPoint( array[i] );
context.m_doc.AddObject(point_object_array[i]);
}
Note that array is an ON_3dPointArray of size 4. After some changes (of array, and attributes) I need to replace it, trying this
CRhinoPointObject** new_point_object_array = new CRhinoPointObject*[4];
for (int i = 0; i < 4; i++) {
new_point_object_array[i] = new CRhinoPointObject();
new_point_object_array[i]->SetPoint( array[i] );
context.m_doc.ReplaceObject(point_object_array[i], new_point_object_array[i]);
}
context.m_doc.Redraw();
but it doesn’t work… Maybe because of the **pointer? Is there a workaround for this?
ON_nil_uuid is a null (e.g. empty or zero) UUID. Rhino objects do not have null UUIDs. Thus, ON_nil_uuid is used to indicate that the object does not exist, in this context.
This is why the sample checks for null UUID and, if so, adds a new object. If the UUID is not null, then is assumed that the object already exists. Thus, the code replaced the geometry.