Get component in Group by Group Name

Hi,
I’m trying get all component and nickname in Group 2 by ghpython.
Do we have any example for that?
Thak you.

try this

from Grasshopper.Kernel.Special import GH_Group

doc = ghenv.Component.OnPingDocument()
if(doc):
    for obj in doc.Objects:
        if(type(obj) == GH_Group and obj.NickName == name):
            groupcoms = [com.Name for com in obj.Objects()]


find_group_component.gh (8.0 KB)

2 Likes

Thank you, you save my day.

Hi,
I have problem , I have create 2 step for take information, after run step 1 the result not show compoent ran, so I have to create step 2, it look like need refesh after step 1 for take information. Can we combine 2 step in 1?
Thank you.