Filling an instance shared parameter with sequence number for each different family type

Hi all,
I am trying to fill a shared parameter with sequence number for all of the instances inside each family type in the project (i will give a sequence number for all of the instances inside each family type). I want to organize this sequencing by level which means that the first instance of the first family type located in level 1 will be number 1 till the end of the levels and till the end of the instances of this type in the project.
Can anyone support with that?

Hi Tony, can you please post an image of your script, indicating where you are stuck? Thanks

1 Like


Dear Azubike, here is a snapshot from the script, but as you can see the highlighted part it is reading null!

Next time come back early if anyone ask you to provide images who is trying to help. Follow the guidelines How to get help on the Dynamo forums

2 Likes

I don’t see why you need the list.create node coming from the AllElementOfCategories node. I think it is throwing your list structure off in the set parameter node.

i needed to make them two lists so that each item from the list would read from the equivalent list

I have made some modifications to the script but now all of the values for the elements have the same value!!!

As I understand it, you want to add a counting number to a parameter… if thats right, then should this do it.
Home.dyn (4.0 KB)

Dear Erfajo,
Thanks, your script seems much easier

The only problem is that i am trying to give a sequence number to each element of the family type.

I tried using your script and modifying the first part to read all of the family types like this:

but now in revit, each family type is reading the same sequence number like this:

I have mentioned in red how i want the result

How can i solve this?

Add a “GroupByKey” after collecting all elements, for key use “Element.Name”, and from there proceed :slight_smile:

You always have the solution :slight_smile:

But excuse my ignorance as i am still a beginner with dynamo
Sequence parameter Trials.dyn (19.6 KB)

This is my script, i have placed the “GroupByKey” but i couldn’t know which node to use for the “Element.ElementName” :frowning:

Extending my previous solution… I have added two alternatives for using types as keys as well (the nodes that has no out connections), just in case :slight_smile:
Home.dyn (7.3 KB)

Thanks Erfajo :slight_smile: