registerRedrawViewsCallback (C#)


Anybody knows how we can write a viewport listener in C# by using Autodesk.max or ManagedService? Something like registerRedrawViewsCallback in Maxscript.


This is the only link I have. It’s for node’s callbacks, but perhaps it can help you:


Thanks, But I could’t find a way to register RedrawView or TimeChange callbacks.


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.


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());