Plugin install folder?

“Commands” in a plug-in in V6. Only .NET plug-ins have associated Assemblies and the Commands plug-in is a .NET plug-in. The Toolbars plug-in is also .NET based and exists in V5.

Your custom plug-in should also be .NET based (unless you suddenly picked up C++ without telling us). If that plug-in is not working with your script, then we should look at that specific case. It would probably be best to send us your plug-in so we can see what is going wrong.

This is what I get for “Commands” in WIP. How about you?

1 Like

Ah, “Commands” in WIP… I was testing in V5. In V6 it works.
I’ll see if I can send the plugin so you can check.

The odd thing is that Rhino.PlugIns.PlugIn.PathFromId() works and gives the result I need.

I used the Rhino.PlugIns.PlugIn.Find() in Holomark2 and that’s what didn’t work now. I’ll look into it some more though.

I don’t think that is odd. There is also the possibility that the plug-in isn’t loaded and Find will only give you an already loaded plug-ins

Hi Steve, yeah that makes sense, but the plugin is installed and works like a charm. And in my logic if this works:

id= rs.PlugInId (“CustomPlugin”)

print Rhino.PlugIns.PlugIn.PathFromId( id )

then

plugin = Rhino.PlugIns.PlugIn.Find( id )
print plugin.Assembly.Location

should work too.

Rhino.PlugIns.PlugIn.Find does not load plug-ins. Are you sure that CustomPlugIn is loaded already?

Yes, absolutely100% sure. As I said, it is up and running great.
After multiple restarts of Rhino even.
Just ignore the name I use for the plugin, I just changed it here so it is more generic.

Point is that I needed to find the folder it was installed in, and
“plugin = Rhino.PlugIns.PlugIn.Find( id )”
“print plugin.Assembly.Location”
only returned “None”
So I looked for an alternative way as I knew it was installed and working and the options page with plugins also showed the correct path. That’s when I found Rhino.PlugIns.PlugIn.PathFromId( id ) and that worked just fine.

So I reported the “bug”, but I understand that you doubt that it is a bug.
I’ll see if I can send you the plugin or make a new dummy that causes the same error. Holomark2 should also cause that. Test in V5 first.

It’s not that I doubt you, I just don’t have a sample. Giulio showed this working with the Commands plug-in in V6 and I also am having a hard time understand a case where a System.Reflection.Assembly instance would return None for it’s location (I know in-memory Assemblies can do this, but plug-ins are loaded off disk).

If you just call print plugin.Assembly, what output do you get?

Hi @Holo,
I did not read the whole thread, so sorry if I miss the point!
Usually installed plugins are only loaded into memory on demand; means once you run a command.
Therefore plugin.Assembly.Location should work if the code is part of the plugin.
The separate script also returns the path if you run one of your plugin’s command manually before running the script, and load it to memory that way.
HTH
Jess