List of the components from CurveComponents.gha?

Hello
How to get the list of all components from CurveComponents.gha ?

import clr
clr.AddReferenceToFileAndPath(r"C:\Program Files\Rhino 7\Plug-ins\Grasshopper\Components\CurveComponents.gha")
import CurveComponents

image

Hi @seghierkhaled ,
Not sure what you want to do exactly, but this will give you a list of all components from CurveComponents.gha

import clr
clr.AddReferenceToFileAndPath(r"C:\Program Files\Rhino 7\Plug-ins\Grasshopper\Grasshopper.dll")
import Grasshopper as gh


libs = gh.Instances.ComponentServer.Libraries

for lib in libs:
    if lib.Name == "Curve Components":
        comps = gh.Instances.ComponentServer.FindObjects(lib.Id)
        for comp in comps:
            compInstance = comp.CreateInstance()
            if(isinstance(compInstance, gh.Kernel.GH_Component)):
                print(comp.Type)
1 Like

Thank you @Darryl_Menezes

I want use it to add component to the canvas without using ExpireSolution and to quickly find the component by name