Which DLLs do I need?

This is more of a general question.
There are a bunch of DLLs in C:\Program Files\Rhino 6\System
Which ones are meaningful to reference when creating Rhino plugin?
Say I want to use C# (very doubtful) or IronPython (more likely).
GUI, no GUI, Grasshopper, NoGrasshopper whatever kind of .Net plugin.

Thanks in advance.

What is the difference between the listed below libraries, in terms of result when used in the plugin?

  • Rhino.UI.dll
  • Rhino.Windows.dll
  • Eto.WPF.dll
  • Eto.dll
  • or simply using any other .net WPF library?

Rhino.UI.dll provides the namespace Rhino.UI ( see RhinoCommon SDK docs). RhinoWindows.dll the RhinoWindows namespace where Windows-specific implementations can be found (controls but also runtime specific).

Eto is the GUI library of Rhinos choice. Eto.dll is the main DLL, but needs a platform-specific backing DLL, on Windows that is Eto.WPF.dll.

All of these you need only when you actually use functionality provided by them. If don’t do anything GUI nor funky platform-specific you most likely won’t need them.

Yeah, I know that, but there are dlls there with women names, Nancy, Cecil you name it.

Which DLLs are the bare minimum that I need to create a plugin?

  • RhinoCommon.dll
  • Eto.WPF.dll
  • Grasshopper.dll
  • I assume also Yak.dll for packaging to be visible in _TestPackageManager

What else?

The bare minimum is RhinoCommon.dll.

1 Like

Is ZooClient.dll used by plugins or only used by Rhino.exe for its licensing?

For more info how to make your plug-in Zoo aware check

Usage if Yak is explained here (it is a tool)

1 Like

:smiley: I see the thread being marked, just want to explain myself, I’m not trying to figure out a way to hack your software.

I want to try using WingIDE to create some scripts and plugins for Rhino. For that I need in advance to know which DLLs I am going to use in order to create the .pi files.

What is a .pi file?

python interface as far as I could understand. it allows you to get autocompletion of DLLs when you import them.

http://www.voidspace.org.uk/ironpython/wing-how-to.shtml

pi generation script basically translating .net methods into python defs.
generates one pi file for each namespace

Have you tried the type hinting packages that I recently blogged about? Autocomplete and Type Hints with Python Scripts for Rhino/Grasshopper | Steve Baer's Notes

I haven’t installed WingIDE, but their home page reports that they support type hinting.

And for this thread, I would recommend just sticking with RhinoCommon as part of this experiment. That is the bare minimum needed for writing a plugin. The next two that would be worth investigating are Grasshopper and Eto (not Eto.WPF). Grasshopper is for working with Grasshopper and Eto is for creating dialogs and other such user interfaces.

Thank you Steve.

I haven’t read your article. But I also tried PyCharm yesterday. Even though I really like it’s IronPython terminal integration I was about to ditch it because I could not find how to make the Type hinting work for ipy.

I’ll definitely try pythonstabs today.
Can I use this with any .net DLLs, or just Rhino related?

stubs and pi files seem very similar

here’s an example of a pi file (IronPython.Runtime.Binding.pi):

# coding: utf-8
# AUTO-GENERATED FILE -- DO NOT EDIT

""" NamespaceTracker represent a CLS namespace.

 """

class ContextArgBuilder(ArgBuilder):
    """ ArgBuilder which provides the CodeContext parameter to a method.
    
    ContextArgBuilder(info: ParameterInfo)
     """

    ConsumedArgumentCount = property(None, None, None,
                                     """ Get: ConsumedArgumentCount(self: ContextArgBuilder) -> int
                                     
                                      """
                                     )

    Priority = property(None, None, None,
                        """ Get: Priority(self: ContextArgBuilder) -> int
                        
                         """
                        )


    def ReferenceEquals(self, arg0, arg1):
        """ ReferenceEquals(objA: object, objB: object) -> bool
        
            Determines whether the specified System.Object instances are the same instance.
        
            objA: The first object to compare.
            objB: The second object  to compare.
            Returns: ue if objA is the same instance as objB or if both are null; otherwise, lse.
         """
        return None

    def ToExpression(self, arg0, arg1, arg2, arg3=None):
        """ ToExpression(self: ContextArgBuilder, resolver: OverloadResolver, args: RestrictedArguments, hasBeenUsed: Array[bool]) -> Expression
         """
        return None

class IPythonExpandable:
    """ Interface used to mark objects which contain a dictionary of custom attributes that shadow
                their existing attributes in a dynamic fashion.
    
     """

    Context = property(None, None, None,
                       """ Get: Context(self: IPythonExpandable) -> CodeContext
                       
                        """
                       )

    CustomAttributes = property(None, None, None,
                                """ Get: CustomAttributes(self: IPythonExpandable) -> IDictionary[str, object]
                                
                                 """
                                )


    def EnsureCustomAttributes(self):
        """ EnsureCustomAttributes(self: IPythonExpandable) -> IDictionary[str, object]
        
            Ensures that a non-null IDictionary instance is created for CustomAttributes and
                
                 returns it.
        
         """
        import System.Collections.Generic
        return System.Collections.Generic.IDictionary`2()

class MetaExpandable(DynamicMetaObject):
    """ MetaExpandable[T](parameter: Expression, value: IPythonExpandable)
     """

    def BindDeleteMember(self, binder):
        """ BindDeleteMember(self: MetaExpandable[T], binder: DeleteMemberBinder) -> DynamicMetaObject
         """
        import System.Dynamic
        return System.Dynamic.DynamicMetaObject()

    def BindGetMember(self, binder):
        """ BindGetMember(self: MetaExpandable[T], binder: GetMemberBinder) -> DynamicMetaObject
         """
        import System.Dynamic
        return System.Dynamic.DynamicMetaObject()

    def BindInvokeMember(self, binder, args):
        """ BindInvokeMember(self: MetaExpandable[T], binder: InvokeMemberBinder, args: Array[DynamicMetaObject]) -> DynamicMetaObject
         """
        import System.Dynamic
        return System.Dynamic.DynamicMetaObject()

    def BindSetMember(self, binder, value):
        """ BindSetMember(self: MetaExpandable[T], binder: SetMemberBinder, value: DynamicMetaObject) -> DynamicMetaObject
         """
        import System.Dynamic
        return System.Dynamic.DynamicMetaObject()

    def Create(self, arg0, arg1):
        """ Create(value: object, expression: Expression) -> DynamicMetaObject
        
            Creates a meta-object for the specified object.
        
            value: The object to get a meta-object for.
            expression: The expression representing this System.Dynamic.DynamicMetaObject during the dynamic 
             binding process.
        
            Returns: If the given object implements System.Dynamic.IDynamicMetaObjectProvider and is not a 
             remote object from outside the current AppDomain, returns the object's specific 
             meta-object returned by 
             System.Dynamic.IDynamicMetaObjectProvider.GetMetaObject(System.Linq.Expressions.Expression
             ). Otherwise a plain new meta-object with no restrictions is created and returned.
        
         """
        return None

    EmptyMetaObjects = None

    def GetDynamicMemberNames(self):
        """ GetDynamicMemberNames(self: MetaExpandable[T]) -> IEnumerable[str]
         """
        import System.Collections.Generic
        return System.Collections.Generic.IEnumerable`1()

    def ReferenceEquals(self, arg0, arg1):
        """ ReferenceEquals(objA: object, objB: object) -> bool
        
            Determines whether the specified System.Object instances are the same instance.
        
            objA: The first object to compare.
            objB: The second object  to compare.
            Returns: ue if objA is the same instance as objB or if both are null; otherwise, lse.
         """
        return None

    Value = property(None, None, None,
class SiteLocalStorageBuilder(ArgBuilder):
    """ SiteLocalStorageBuilder(info: ParameterInfo)
     """

    ConsumedArgumentCount = property(None, None, None,
                                     """ Get: ConsumedArgumentCount(self: SiteLocalStorageBuilder) -> int
                                     
                                      """
                                     )

    Priority = property(None, None, None,
                        """ Get: Priority(self: SiteLocalStorageBuilder) -> int
                        
                         """
                        )


    def ReferenceEquals(self, arg0, arg1):
        """ ReferenceEquals(objA: object, objB: object) -> bool
        
            Determines whether the specified System.Object instances are the same instance.
        
            objA: The first object to compare.
            objB: The second object  to compare.
            Returns: ue if objA is the same instance as objB or if both are null; otherwise, lse.
         """
        return None

    def ToExpression(self, arg0, arg1, arg2, arg3=None):
        """ ToExpression(self: SiteLocalStorageBuilder, resolver: OverloadResolver, args: RestrictedArguments, hasBeenUsed: Array[bool]) -> Expression
         """
        return None


@stevebaer,

Could you please split this thread I want to ask more questions for the stubs.

Thanks in advance.

They are called “stubs”. Did I misspell something in my blog or in a discourse post?

Feel free to just start a new thread. Seems like this one has been answered and is complete

No, I did :smiley:

Btw,

I am using IronPython standalone and added to PyCharm.
I cannot install packages to IronPython, you have to explicitly set your project interpreter to CPython2.7 in order for it to work I guess.

Also, I could not install the package from inside PyCharm, I had to pip install rhino-stubs from cmd.exe
(PyCharm 2017.3.4) I know I need to update but I’m using the portableapps version for the time being.

I don’t know if the older version will work with this. I had an earlier 2018 version on Mac that didn’t work and updating to the latest version fixed it.

Can you help me understand what exactly it is that you are trying to do?

For starters finding the best IDE to use with IronPython.
Then I’ll try hooking it up to Rhino.

  • create a plugin from some of the scripts I already have.
  • I want to create a skin for rhino using IronPython, but to know what am I doing I need the type hinting :slight_smile:
  • I can try to create also a tool to compile my GH plugins, currently I compile them from inside Grasshopper with ghpython. I wish to move it out.

PS: I don’t want to use Visual Studio, nor C#:

  1. VS is loading a lot of shit I don’t want and it takes forever to load.
  2. C# is not dynamically typed and I have to compile to test everything. I hate that.
  3. Oh the most important thing. Not portable.