Grasshopper

algorithmic modeling for Rhino

Trying to show currently installed plug-ins with python component

In Grasshopper->File->Preferences->Solver, you are able to see installed Plug-ins.

Is there a way to list those in a Python component?  I want to see which plug-ins are loaded.  I tried this, (but it gives me every component name....)

import Grasshopper as gh

for i in gh.GH_InstanceServer.ComponentServer.ObjectProxyNames: print i

I am looking through the GH SDK, but haven't been able to find it yet.  Is it available?

Views: 292

Replies to This Discussion

Hi Chris,

See this discussion.

/SPM

This should give a list of all the loaded libraries.

import os
import Grasshopper

plugins = [os.path.split(addon)[1] for addon in Grasshopper.Instances.ComponentServer.AllAddOns if addon.lower().endswith(".gha")]

Thanks!  That is exactly what I was looking for!  The purpose is for creating a bit of a "de-bugging aid" component.  It's probably overkill on my part, but as we have some folks in our office writing a few bits of custom components, and it's helpful to be able to quickly gather some relevant information about their systems.  This is the component I am putting together.

Do you think there are any other relevant pieces of information that might make sense to include in this?  (Assuming the purpose of it is really a reference and troubleshooting utility....not at all for geometry creation or manipulation).

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service