Dealing with changes in geometry while maintaining the same GUID

Hello all.

I’ve come across a problem, I’ve not had to deal with before and I am just wondering what is best practice here.

I have a Rhino.DocObjects.RhinoObject my_object, which in this case is a line, however, sometimes (depending upon its construction history), its Geometry property may not necessarily be stored as a Rhino.RhinoGeometry.LineCurve. I would like to have an Rhino.DocObjects.RhinoObject (‘lets call it my_new_object’) that has the same attributes and GUID as the first, however, its geometry is what i specifically set it to.

Is the best practice, to remove my_object from the object table and set my_new_object’s GUID and attributes to be identical to my_object’s?

Thanks in advance.


Why do you need this? I don’t think you can set the GUID.

You may be able to use the object table’s Replace method, see ObjectTable.Replace Method

1 Like