ScriptEditor PlugIn > override Command, DisplayConduit, PlugIn, UserData

Is it possible to add the attached 4 plugin files to ScriptEditor and build a project as a Rhino Plugin as you would normally do using Visual Studio?

SampleCsMobilePlanePlugIn.cs (1.0 KB)
SampleCsMobilePlaneUserData.cs (6.2 KB)
SampleCsMobilePlaneCommand.cs (5.4 KB)
SampleCsMobilePlaneConduit.cs (990 Bytes)

@eirannejad is there any solution for this or ScriptEditor is only using for scripts?

The section of ScriptEditor called commands are always wrapped into RhinoPlugin commands, so there is an infrastructure and you generate .rhp files. But you cannot achieve a real plugin infrastructure for overriding plugin Command, DisplayConduit, PlugIn, UserData or is there something we could actually go around this wrap and build a normal rhinoplugin?

I guess it is impossible to do this:


import Rhino

class SampleCsMobilePlanePlugIn(Rhino.PlugIns.PlugIn):

    def __init__(self):
        super().__init__()  # Call base class constructor
        self.Instance = self

    def OnUndeleteRhinoObject(sender: object, e: Rhino.DocObjects.RhinoObjectEventArgs):
        pass

    def OnLoad(self, errorMessage: str):
        Rhino.RhinoDoc.UndeleteRhinoObject += self.OnUndeleteRhinoObject
        return Rhino.PlugIns.LoadReturnCode.Success

When C# is not an option:


using Rhino;
using Rhino.DocObjects;
using Rhino.PlugIns;

namespace SampleCsMobilePlane
{
  public class SampleCsMobilePlanePlugIn : PlugIn
  {
    public SampleCsMobilePlanePlugIn()
    {
      Instance = this;
    }

    public static SampleCsMobilePlanePlugIn Instance
    {
      get;
      private set;
    }

    protected override LoadReturnCode OnLoad(ref string errorMessage)
    {
      RhinoDoc.UndeleteRhinoObject += OnUndeleteRhinoObject;
      return LoadReturnCode.Success;
    }




    void OnUndeleteRhinoObject(object sender, RhinoObjectEventArgs e)
    {
      SampleCsMobilePlaneUserData.Refresh(e.TheObject, false);
    }
  }
}

I see the automation in ScriptEditor, but because of this we are not able to access Command, DisplayConduit, PlugIn, UserData overrides or can we?

1 Like