Automatic Sequential Numbering of Families (Sublist organization):

Hey everyone, last ditched effort to try and figure this out. I have attached my script in hopes someone can take a look and let me know what I am doing wrong. I am trying to create an automated numbering system which organized components by two categories:

1.) “A: Type Abbreviation” = Type Parameter (Sp & Sub)

then

2.) “Level” = Built in Revit Parameter.

The ultimate goal is to apply a numbering sequence based on the “A: Type Abbreviation” that changes the first number to 1, 2, or 3 depending on the level.

Example:

1st Level (SP) = 101,102,…109, 110

2nd Level (SP) = 201, 202,…209, 210

2nd Level (SUB) = 201, 202,… 209, 210

The elements themselves are hosted to levels, but for some reason I cannot get the correct output. In the screenshot, theres a group that I called “Correct Numbers".” This numbering is the correct input. When I go to apply it to my output (A: Mark #), I get one of three errors:

1.) Attaching back to the start “All Elements of Category” node, the system freezes

2.) Attaching back to the first “List.GroupByKey” node, the list returns as if the levels do not exist

3.) Attaching back to the second “List.GroupByKey” node, the list returns null for all items

Tried to be as clear as possible. Let me know if I need to re-explain anything. Thank you in advance.

Hi,

The main issue is that you’re tryint to set parameter value to the groupped list of Levels, not the Elements. Also you need to sort and group elements by level name I guess.

And If you want to set parameter using grouped list of elements or(and) values, you’ll need to play with list levels in Element.SetParameter node. To get rid of this, I would suggest to Flatten both elements and values lists before setting parameter value.

By the way, If you’ll upload further graph image, please make sure that node names are visible.

Better to use list levels and lacing - longest lacing with @L1 for the parameter name and everything else to @L2 if my intuition on the list structures are correct.

@jacob.small @Andriy

A couple points: as it relates to list organization, I agree. The “Correct Numbering” correctly groups and numbers in the correct sequence. It when I try and apply that number sequencing to "“Element.SetParameterByName” it bugs out.

This leads me to my second point which is when “Element.SetParameterByName”/”Element” is connected to original all elements of Category, it bugs out. This makes sense because I don’t need to reference all elements.” But, when I connect it either the first or second List.GroupByKey I get different information between “Correct Information” and “Correct Numbering”