Get plug-in object using RhinoCommon


#1

Hello Community,

I try to get the plug in object using RhinoCommon in python but the RhinoCommon function keep returning me None…

I am sure that I missed somthing…

Here the code trying to get the plug in “Calc” object in standard in Rhinoceros.

# coding=utf-8

import rhinoscriptsyntax as rs
import Rhino 
import scriptcontext 


def Main():
	
	
	IdPlugIn = Rhino.PlugIns.PlugIn.IdFromName("Calc")
	
	objPlugIn = Rhino.PlugIns.PlugIn.Find(IdPlugIn)
	
	print IdPlugIn , " " , IdPlugIn.GetType()
	print objPlugIn
	
	
	return


if( __name__ == "__main__" ):
	Main()

It return:

f967607d-dfdc-497e-9fa6-28acedd332c7   System.Guid
None

I thank you in advance for the hand.

Loïc

PS : I use the last SR 9 version 64bit


(Dale Fugier) #2

What do you need to get a plug-in object? What are you trying to do?


#3

Hello,

I am develloping a small updater for my small Rhino plugin that I devellop. I wanted to create a button to activate / not the plugin…

All is working fin for the updater part, the only thing I need to grab the plugin version. I wanted to use the existing function in the RhinoCommon.

I want to get the plugin object to access to some properties / methode like: Rhino.Plugins.plugin.LoadTime or getting the version, etc…

The fucntion I am trying to use is supposed to return the object for the Guid but it still returning None.

I am sure I do something wrong, but what?!?

Thank’s


(Dale Fugier) #4

Something’s not right with RhinoCommon. I’ll look into it.

In the mean time, if you need the version number of an assembly, you might look into doing something like this:

AssemblyName.GetAssemblyName("plugin.rhp").Version

#5

Thank you very much Dale.

Congrate to you and your team for the fabulouse software & for you reactivity.

You temporary solution helps me a lot!

Thank’s

Loïc