I am not sure I understand use of [System.Runtime.InteropServices.Guid(“00000000-0000-0000-0000-000000000000
”)] attrubute. Should i use it before every command?
Would appreciate if someone could explain when and why should one use this attribute. ( I am not planning to interface with COM. )
Here is typical structure i have used for multiple commands.
[System.Runtime.InteropServices.Guid("259CB426-2F44-4B03-A818-DAA7413C432D")]
public class MyProject_Command1 : Command
{
public MyProject_Command1()
{
Instance = this;
}
public static MyProject_Command1 Instance
{
get;
private set;
}
public override string EnglishName
{
get { return "MyProject_Command1"; }
}
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
return Result.Success;
}
}
[System.Runtime.InteropServices.Guid("dd6c90d3-5fc7-48bb-9776-1e34886cc954")]
public class MyProject_Command2 : Command
{
public MyProject_Command2()
{
Instance = this;
}
public static MyProject_Command2 Instance
{
get;
private set;
}
public override string EnglishName
{
get { return "MyProject_Command2"; }
}
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
return Result.Success;
}
}