C# SDK definitely needs more examples than what's now available in the reference...
Yes, what you want is possible:
using Autodesk.Max;
namespace MyNamespace
{
public class MyFuncs
{
public static IValue MyFunc( IValue val, int count )
{
GlobalInterface.Instance.TheListener.EditStream.Puts( ">>> MyFunc\n" );
return GlobalInterface.Instance.TrueValue;
}
static public bool RegisterMaxscriptFunction( string name )
{
return GlobalInterface.Instance.Primitive.Create( name, MyFunc, (short)(primitive_flag.LazyPrimitive | primitive_flag.DebuggerSafe) ) != null;
}
public MyFuncs()
{
RegisterMaxscriptFunction( "MyFunc" );
}
public static void AssemblyLoad()
{
}
public static void AssemblyMain()
{
}
}
}
Compile this code to .dlx and put it in /maxroot/bin/assemblies folder
Then, whenever you create an instance of the class functions defined in class will be registered
x = dotNetObject "MyNamespace.MyFuncs"
or you can make this class static and call RegisterMaxscriptFunction whenever you need to.
I hope someone more experienced than I am could tell a little bit more about how is it supposed to work.