On 01/09/2017 at 14:28, xxxxxxxx wrote:
what would be the best way to make objects unremovable? I have an ObjectData with some children in it. I need the children to get input from positions, rotations etc. So it is important to be able to activate them. But I want them to be not removable from the document.
Ive tried 2 ways.
1. Checking if the children still exist, if not do Undo with doc.DoUndo(). But I didnt get it to work. I think it isn´t possible to call DoUndo() from ObjectData. EDIT: It is possible anyhow, but I think doing undo isn´t the smartest way.
2. Storing clones of active children (with parent and pred) in a class member and if a child doesn´t exist anylonger the clone will be inserted. Works, but I have troubles with undos.
So how can I protect objects against removing from OM, scene, document?
Thx and greetings