# Beginners question about sorting elements

hello,
i am trying to learn, how to combine elements into groups, to feed a function:

i have 4 cubes created in grasshopper

i feed the CUSTOM PREVIEW-geometry input with

1. cube 1
2. cube 2
3. cube 3+4

on the other hand i have created a list of material names, and feed those into the material parameter of CUSTOM PREVIEW (names a-z for testing purpose)

now i already can bake all cubes at once, and they all have the material from the list , one after another.

but:

what ever i try,
i cannot achve the following assignment:

cube 1 - material a
cube 2 - material b
cube 3+4 - material c

i tried grafting and other options, but cannot find a solution.

can anyone help?

the general goal ist :

• a general bever-changing list of materials a-z

• a row of slots for the geometry

• assigning geometry to a desired slot (1 or more elements)

• baking all this at once with the desired material.

advantage: always the same material name while re-baking the materials and showing in lumion (where the material name must always remain the same in the imported model to keep the assigned texture).

thanx a lot

stan

edit: i tried flattening with ENTWINE today,
so elements get sorted , but i still get material names skipped (a,b,d)

reault:
cube 1 - material a
cube 2 - material b
cube 3+4 - material d

i keep on searchingâ€¦

stan

Post your .gh and .3dm files.
Entwine should work.

hello,
i just prepare it.

desired result
geo 1 > material / color 1 (here: single cube)
geo 2 > material / color 2 (here: single cube)
geo 3 > material / color 3 (here: 3cubes)
and so on

thanx for any idea
stan
bake-zf_01d.gh (46.6 KB)

You need to build a structure like this:

materials entwine.gh (75.2 KB)

bake-zf_01d.gh (41.5 KB)
You were using fully transparent materials, only edges were visible, and because you created other components that had the same edges you were unable to see any difference.
You used many different entwine components, resulting in wrong tree structure.

In your case, as you cave already a list of materials, it is enough to graft that list.
Note that you have one more branch of geometries than the amount of materials.

hello and thanx - i will try to follow you !

my other approach was a toggeld multi-bake.
but here i also do not get any geometry bakedâ€¦

stan
bake-zf_01b_2.gh (51.4 KB)

so with your solution it works perfectly.
thanx.#

i tried the next step -

sorting of geometry from your script

materials from mine

and again, the c-material from the list is skipped.
there must be some mistake n my color-generator, i just cannot see.

EDIT: GOT IT

THERE IS ONLY 1 GEO INPUT in ENTWINE ALLOWED PER SLOT !!!

Thanx a lot for helping me !!!

stan

1 Like