Set parameter after adaptive components by points

Hi all,

Currently i’m workin on a script that fill’s in a parameter after the adaptive family has been placed.
why i’m doiing this: i have multiple adaptive families which wil be used multiple times in my model. but for the 4th dimension(date and time) we have added the parameter “4D-code”. from there the time schedule will recognise that element and connect it.

So this is how my 3d model look when selecting an adaptive family


this is how my script looks:

but there is something going wrong. after the node ‘all elements of family type’ the list is way long than the amoun of elements i place. so i don’t get it what i’m doiing wrong?

thanks in advance,

Gr Edward

Try flattening the list of types and pulling just the unique values. Looks like you are asking for all elements of type ‘familyTypeNameHere’ repeatedly, so you’re getting duplicated lists.

@JacobSmall thanks for your reply.
it’s probably a part of the solution, but see the picture below.

when using the unique items, the order of the list has changed.
which is not what i wanted as the ‘4D-code’ is in the same order of the adaptive families that er placed by the function ‘adaptivecomponent by points’.

is there a way get the list from ‘all elements of family type’ back in the order as it was before?

Gr Edward

Then why not just set the instance parameter for the elements themselves? No need to go to types so you can come back to instances, setting the parameter directly should resolve the issue directly.

Hello @1234eddie ,

I think , you are calling one family type - multiple times and “All element of family Type” node will give all the element of that family type - multiple times.

Before or after “All element of family Type” use “List.flattern” and “unique list”. so it will remove all duplicate “family type” present in the list. then you will all the element of family type correctly.

Hi @JacobSmall

maybe my explantion of what i’m trying to achieve is a little bit unclear.

See the picture below.

what i have is an adaptive family called BPL001/BPL002. as you can see this family will be placed multiple times with ‘adaptive components by points’, in order from left to right.
and when these are placed i need to fill in the 4D-code(as time reference for Navisworks).

so my question is still the same from post 3

is there a way get the list from ‘all elements of family type’ back in the order as it was before?

Many thanks in advance

Why not create them in that order, and set the parameters accordingly. All Elements of Family Type is adding a layer of complexity which you don’t need, nor want. Set the parameter for the element you already have, rather than asking for all elements of family type and having to filter - it’s extra steps, and as soon as you ask for all elements of family type “BPL001” it will pull indexes [0,2,3,6,7,8] each time you request it. Just use the element at index 0 for A, index 1 and 2 for B, 3 for C, 4 for D and so on.