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

#1

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?

#2

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

1 Like
#3

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

#4

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
#5

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.

#6

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!!!

#7

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)

#8

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?

#9

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

#10

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:

#11

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)

#12

Thanks Erfajo :slight_smile: