Plugin on C#

 
 
 
Posted by:kolts
Data created:3 October 2012

How to make plugin in 3ds max 2013?

I wrote this code but it dont works

//-----------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Autodesk.Max;
using Autodesk.Max.Plugins;

namespace Plane
{
public class PlaneDescriptor : ClassDesc2
{
IGlobal global;

internal static IClass_ID classID;

public PlaneDescriptor(IGlobal global_)
{
this.global = global_;

classID = global.Class_ID.Create(253674,23564);

}

public override string Category
{
get { return "Max .NET Tutorial"; }
}

public override IClass_ID ClassID
{
get { return classID; }
}

public override string ClassName
{
get { return "Plane"; }
}

public override object Create(bool loading)
{
return new Plane();
}

public override bool IsPublic
{
get { return true; }
}

public override SClass_ID SuperClassID
{
get { return SClass_ID.Geomobject; }
}
}
public class Plane : SimpleObject2
{
public override void BuildMesh(int t)
{
}

public override ICreateMouseCallBack CreateMouseCallBack
{
get { return null; }
}

public override RefResult NotifyRefChanged(IInterval changeInt, IReferenceTarget hTarget, ref UIntPtr partID, RefMessage message)
{
return RefResult.Succeed;
}
}

public static class AssemblyFunctions
{
public static void AssemblyMain()
{
var g = Autodesk.Max.GlobalInterface.Instance;
var i = g.COREInterface13;
i.AddClass(new PlaneDescriptor(g));
}

}
 }

/-------------------------------------------------------------------

For Max.net dont need function AssemblyMain() but now it need, but it dont works. 3ds max crashes on start. Can somebody help?