I have to develop a plugin that is able to create and mantain a simple relation between objects.
More in dept, I want to create a surface (let’s call it “S”) using 2 input curves (let’s call them “C1” and “C2”).
It doesn’t matter how “S” is created but, at the time of its creation, I automatically add information about all the obejcts involved in the operation (and some extra parameters) inside all objects user dictionaries.
Now I’m able to update the “S” surface if one or both curves “C1” and C2" are modified someway, even if the curves are modified by another command.
Everything is working fine except when I’m going to undo the operation: it looks like the “S” surface update is not saved inside Rhino undo stack.
I tried to use commands like BeginUndoRecord/EndUndoRecord, wrapping surface updating, but it seems I get another undo entry in Rhino undo stack: I have to press undo twice to come back to the original document status.
Is there some way to “merge” all the operations in a single one, so that undoing them requires just a single “undo” execution?
Do you know a better/different way to setup a relation like the one I need?
Thanks a lot.