registerRedrawViewsCallback (C#)


#1

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


#2

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


#3

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


#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.


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