gknu2013
(AlexF)
October 26, 2025, 8:33am
1
In the example i Have 4 groups of object
I have 2 curve in each group
I want to make a tree in grasshopper based on groups
I have the solution, but i wonder, CAn i do it without human plugin,
component query object have group name filter how i can use it to make same effect as i did it with human plugin
How i can extract group name from object belongs it?
tree data by group in rhino.gh (16.5 KB)
4 group .3dm (45.0 KB)
Tom_P
October 26, 2025, 1:20pm
2
group info is stored by indes in the ObjectAttributes.
A Object can belong to more then one group - or to none.
https://developer.rhino3d.com/api/rhinocommon/rhino.docobjects.objectattributes/getgrouplist
group indices of your input might not be continuous.
EDIT:
the following approach uses the same Human Component as initial Post.
and therefor does not answer “vanilla” gh solution
my approach would be to use the indices or a set of the indices to construct pathes and with them construct a tree:
my example gives a rough idea of handling ungrouped input.
(1)
the upper solution:
creating a set of the used indices will allow continuous tree indices.
but the former ungrouped objects are positioned based on where they where selected.
(2)
the solution below
will make sure that the ungrouped objects are at index 0
(3) EDIT
added a third version, a simple sort component will combine both apporaches:
have no-group objects at index 0 - only if there are any !!!
have continous tree indices
RhinoObjects_grouped_to_treeBranch.gh (16.7 KB)
gknu2013
(AlexF)
October 26, 2025, 2:38pm
3
Thank you, but you did same thing as me.
My question was, Can I do the same thing without HUMAN plugin?
Using only components fro Rhino tab
Tom_P
October 26, 2025, 3:12pm
4
ups - my fault - i did not check where the object attributes comes from.
of course you can do it with a script component if this is acceptable ?
gknu2013
(AlexF)
October 26, 2025, 3:17pm
5
Do you mean python script?
There is not component in vanila Grasshopper witch can be usefull, is it?
Tom_P
October 26, 2025, 3:24pm
6
i am not 100% sure - if vanilla gh can do it.
i am more into coding then spaghetti. ;-D
yes do a c# script component and:
private void RunScript(Guid id, ref object groupIndices)
{
groupIndices = null;
RhinoObject rhobj = RhinoDocument.Objects.Find(id);
if (rhobj == null) return;
groupIndices = rhobj.Attributes.GetGroupList();
}
you need to add a guid parameter before the script and inside the script add a using Rhino.DocObjects;
RhinoObjects_grouped_to_treeBranch.gh (12.3 KB)
hope (now) this helps.