Custom grips drag undo doesn't work

Now I know there are more high-level approaches to custom grips, but I prefer to keep this approach for now due to the versatility I may need in the future.

I’m implementing my custom grips and they are working fine, however when I drag a grip, then hit ctrl+z, while the mesh object resets correctly, the grips remain in the old wrong position. I expected these to reset and for CRhinoObjectGrips::NewObject() to be called (it isn’t).

What do I need to add here to make undo work as expected? I don’t (yet) use any custom data attached to the mesh or grips.

Hi @gccdragoonkain,

Undoing a grip editing operation will not call call CRhinoObjectGrips::NewObject(). When you undo something, the previous copy of the object is retrieved from the undo stack.

Without some sample code to reference, I can’t provide much assistance. But the SDK sample I’ve mentioned before works as you’d expect. I suggest reviewing the code to see of you’ve missed something.

– Dale

I think I got it. Turns out CreateGrips (EnableGrips) is being called after every single change, including undo. The data I was using to recreate them was stale. Thanks!