Add/delete/replace events + history/undo + object id

Hi @dale,

can you clarify a bit what kind of events can happen on object creation? In the plugin I’ve been developing I see that once I modify a surface with id_1, let’s say move a control point, these events are fired:

OnReplaceRhinoObject ( id_1)
OnDeleteRhinoObject (id_1)
OnAddRhinoObject (id_1)

now if I undo the edit I get this:
OnReplaceRhinoObject (id_1)
OnDeleteRhinoObject (id_1)

As indicated, during this process, the object id of the modified object stays the same. But here is where it currently goes wrong in my script: If I have an object, let’s say with id_1, and fillet its edges, the object id after the filletedge is still id_1. But now I choose to edit the fillet, then I get these events:

OnAddRhinoObject (id_2)
OnReplaceRhinoObject ( id_2)
OnDeleteRhinoObject (id_2)
OnAddRhinoObject (id_2)
OnDeleteRhinoObject (id_1)

I can probably find a way to detect if that happens, but I am wondering, are there more scenario’s with other commands that can happen that I need to be aware of?

Hi @Gijs,

Do the comments for RhinoDoc.ReplaceRhinoObject help? If not, I’ll need a way to repeat to provide anything additional.

– Dale

Hi @dale I’ve read that info before and it is helpful but it does not help me in solving the illustrated issue.

In case of the filleted object, I would expect the object id to stay the same if the fillet is edited. Why is this not the case? And how do I know if an object gets replaced with an object that has a different id, because that’s what happens if the FilletEdge is edited…

I can’t seem to find a way to ge that info out of the events.

Hi @Gijs,

Looks like this has something to do with history, recording or updating.

– Dale

I see no difference between history on or history off , here is an example of an object that I edit its filleted edge:
I start with object 08218808-36e1-4c4b-bd6e-db41d72281da
I make a fillet:

replace event 08218808-36e1-4c4b-bd6e-db41d72281da
delete event 08218808-36e1-4c4b-bd6e-db41d72281da
add event 08218808-36e1-4c4b-bd6e-db41d72281da

I edit the fillet:
add event 522c0c0f-4d8c-43a5-96aa-25da9d6f4431
replace event 522c0c0f-4d8c-43a5-96aa-25da9d6f4431
delete event 522c0c0f-4d8c-43a5-96aa-25da9d6f4431
add event 522c0c0f-4d8c-43a5-96aa-25da9d6f4431
delete event 08218808-36e1-4c4b-bd6e-db41d72281da

You can see that in case of editing a fillet, a new object is created, this gets the new set fillet (and generates the replace/delete/add events) and finally the original object gets deleted. But how can I determine, that 08218808-36e1-4c4b-bd6e-db41d72281da has been replaced by 522c0c0f-4d8c-43a5-96aa-25da9d6f4431 ?