GUID of 00000000-0000-0000-0000-000000000000 by design?

I’ve noticed a curiosity when doing the following:

  1. Create a polyline (it gets assigned its own normal guid ‘X’)
  2. Add a knot to that polyline
  3. That polyline for a brief moment gets a guid of 00000000-0000-0000-0000-000000000000 (more specifically during the replace event), than quickly reverts back to its original guid ‘X’

All is visible on the screenshot, the command line output is also visible. Is this a special guid assigned by design for this specific action or something else? Any explanation would be very helpful. Thanks

Hi @Sven_Duplić,

At the time RhinoDoc.ReplaceRhinoObject is called, RhinoReplaceObjectEventArgs.NewRhinoObject has not been added to the document. Thus, the empty GUID.

– Dale

2 Likes

But it is different when I move the polyline.

Here’s the new and the old id of a polyline that is being moved:
!Replace RhinoObject event (old: 084e3056-1c88-4c51-91e9-7a6781393466, new 084e3056-1c88-4c51-91e9-7a6781393466!

Seems like adding the knot logic adds the 0000-00… but replacing logic adds the regular guid 084e…

Some commands copy the existing object’s attributes, that’s all.

I would not count on the “NewObject” id being valid.

– Dale

Thanks. I planned to manually check if the guid of the object was ‘00000-00…’ and than to treat that as the insert knot was done to that curve but that seems off… Is there a better way?