Get Rhino geometry by name

Hello,

in rhino 8 / GH1 geometry from rhino can be imported. I simply want to get a bunch of curves from the rhino document into grasshopper. The curves each have a unique name. I can only get it to import them all at once but I would like to pick a specific one by name. How can I achieve that? I attached what I tried.

Thanks.
get-geometry-by-name.3dm (55.4 KB)
get-geometry-by-name.gh (12.0 KB)

I hope someone can help, please?


get-geometry-by-name_2023Nov10a.gh (11.3 KB)

Yes, that works for my pupose. Thanks a lot!

You could also use Geometry Pipeline:

Otherwise import all and then filter them out:

1 Like

For me, I would recommend using the new “Filters” in Rhino 8. This is the exact type of use case that this feature was created. You can see in the image below that the Query Model Objects brings in all of the curves in your model. I then create an “Equality Filter” where I right-click on the “Key” input and set the drop-down menu to “Common Properties” and then select “Name” in the tree view control. This will tell the filter component to look at all of the names of each object. Then, for the “Value” input we just select which item you want to look for. The filtering components are quite versatile and you can filter for many different attributes other than just name (ie. user text, layer name, material, etc.). And you can combine many filtering rules together to create more complex conditions.

Filter_By_Name.gh (8.5 KB)

2 Likes

Thanks a lot @AndyPayne, I had suspected that the filter component might work for me but I hadn’t quite figured it out. That’s the cleanest way for my purpose.

1 Like