Trim multiple Curves with different Regions attribute mismatch

Hello all! I’m still new at using Grasshopper but trying to fix this process I’ve been working on.

I have multiple regions that do not intersect, each region has a set of curves in it that need to be trimmed. These sets of curves only intersect within their own region and no others. The Trim seems to work so then I want to assign the curves within each region to a new layer. Here is the fault

Using Elefront to set attributes, when I try to assign the new attributes to change color, layer, etc the number incoming attributes don’t match the number of output attributes causing a fault with back objects.

When I set a single curve and a single region, I do not get this error, when I assign multiple regions and curves I get the fault.

Any ideas? Thanks!

You have not provided a file to look at. If you are working with Rhino 8, the new Grasshopper components in the “Rhino” register largely supercede the Elefront components.

Ok not understanding this but I just remade the exact layout in a new file and it worked. ugh…. I was reading something about a new native way to do it. How does that work. Here are the attached files.

test file.3dm (61.2 KB)

Change Layer.gh (16.7 KB)

It seems like eleFront, in this case, is correctly pointing out an error in the first version of your script. It seems like in the screenshot you first sent, the wire indicates you have a single object going into Trim With Regions:

This is likely causing some empty branches in your output. If I recreate that from the file you later posted (meaning I only select one curve), you can see the empty branches:

This means you are actually getting two different data streams going into the Bake component, and your attributes would be be unpredictable, so eleFront is trying to give you a heads up by throwing an error.

As an aside, you seem to be creating attributes using the version of the object after it has been trimmed, which means it won’t actually have any attribute data (since it is no longer the original object). Once you operate on geometry, you lose the Reference to it.

My suggestion would be the following:

Change Layer_WithSuggestion.gh (19.0 KB)

Hope that’s helpful

This is how you can do it with native tools.

Change Layer_rhino8_native.gh (10.6 KB)