Let’s say we are developing a simple plugin that creates a duplicate of an object. each time a new object is added to a Rhino document.
Let’s say we want to link those object (the one added by user and its copy) together: every edit made to an object must be reflected to its copy. So, for instance, if the user deletes one of the two linked object, the other must be deleted too.
More in dept, these are the edits we want to manage: deleting, attributes changing, transformations and… Cutting / copying and pasting!
Let’s say all these operations have to be undone or redone.
What your approach would be?
I don’t need code samples but “just” your ideas.
Thanks a lot!
Hi @software_comas ,
As mentioned by Dale in this post Best place for a document-specific object store to live - #3 by dale
you could use a singleton to store all “your objects”, and then watch for the events and modify your collection accordingly. I have used a similar approach
I’m afraid this is the less important aspect of the question (even if it’s good to know).
The problem isn’t where to store data but how to manage it using Rhino events system.
I mean, after studying Rhino events system for quite a while, I really can’t find a way to (for instance) detect a “cut” of a single object, wich is translated in a set of 9(!) Rhino events that start with a BeginSaveDocument(!?) event and ends with a DeleteRhinoObject event, that has to be catched also for a simple object deleting.
Not mentioning the fact that I need to manage undo/redo operation properly.
Maybe @dale can help…