Hi, I wrote custom component to try to ‘catch’ user activities by getting the undo stack. So what I’m trying to do now is to attach custom callback to record it.
In the main SolveInstance:
GH_Document ghDoc = this.OnPingDocument();
ghDoc.UndoStateChanged += CustomCallback;
void CustomCallback(Object sender, GH_DocUndoEventArgs e)
_ {_
_ Rhino.RhinoApp.WriteLine(“SENDER: " + sender.ToString());_
_ Rhino.RhinoApp.WriteLine(” name: " + e.Record.Name);_
_ Rhino.RhinoApp.WriteLine(" guid: " + e.Record.Guid.ToString());_
_ Rhino.RhinoApp.WriteLine(" time: " + e.Record.Time.ToString());_
_ Rhino.RhinoApp.WriteLine(" state: " + e.Record.State.ToString());_
_ this.OnPingDocument().UndoServer.PushUndoRecord(e.Record);_
}
However, this causes hang when any action is done on the canvas. If I try to move any object, it cannot be dropped (seems like it’s attached to mouse click). Adding ExpireSolution doesnt help either (I think it shouldn’t expire anyway?).
I feel that I might have to add more lines in the custom callback to ‘emulate’ normal procedure, however I am not too familiar with the workflow.
Kindly advice, and thanks in advance!