Triggering a history update?


#1

I am coding a class in RhinoCommon that works kind of like the GumBall, and so I am transforming an object (outside of a command) using the code:
RhinoDoc.ActiveDoc.Objects.Transform(Guid,Trans,true);

the object I am transforming has another child object already created from it with history.

When I transform the object with the above code the child object does not get updated by history.

If a run any other command, at the end of that command running the child object finally catches up, so what can I do to trigger a history update, outside of a command?

P.S. if I manipulate the same object with the gumball every time I mouse up on the gumball the child object is being updated with history. (so what magic does the gumball have on a mouse up that triggers a history update?)


(Menno Deij - van Rijswijk) #2

These kind of things I usually do with RunScript. Each mouse manipulation sends a script, either made from normal Rhino commands, or with a custom command. If you make the custom command hidden, users can’t see it in the list with commands.
This way all the history and undo magic comes for free.


(Dale Fugier) #3

I was going to suggest what Menno describes…


#4

thanks, had not thought of doing it that way round, it is now working for me.