Anybody knows how we can write a viewport listener in C# by using Autodesk.max or ManagedService? Something like registerRedrawViewsCallback in Maxscript.
registerRedrawViewsCallback (C#)
MZ1
#4
There is a function GlobalInterface.Instance.COREInterface.RegisterRedrawViewsCallback, that document says we can pass a IRedrawViewsCallback object to it, But I don’t understand how we can implement this.
MZ1
#5
OK I figure it out, we should inherit from Autodesk.Max.Plugins:
public class MyRedrawViewsCallback : Autodesk.Max.Plugins.RedrawViewsCallback
{
public override void Proc(IInterface ip)
{
// Do stuff here...
}
}
GlobalInterface.Instance.COREInterface.RegisterRedrawViewsCallback(new MyRedrawViewsCallback());