Renumber assembly elements

Hello! Im trying to renumber elemets in multiple assemblies by lenght parameter. In screenshot below i renumber columns and beams based on their lenght, but when im trying to do it with multiple assemblies GroupByKey and SortByKey send an error
I`m trying to achieve something like
Assembly 1 elements:
1,2,3,4,5
A2 elements:
1,2,…

Hi,

Im pretty sure i did something similar to you. in my screenshot i sorted rebar by diameter in my assembly.

List.uniqueitems would get all the unique or different lengths in your assemblies and List.allindicesoff will sort thorugh the whole list.

if you copy this it will give the same value to the elements with the same lengths. so beware of that

I think the error is because you are changing the keys by rounding them, so they are no longer valid/matching to the actual key. This is just an assumption on my part though.

Hi, thanks for your answer, but i have slightly different problem.
Sorting and grouping works fine with only 1 assembly, but adding another assembly and creating sublist is what breaking my script


the result i`m trying to achive is list of assembly elements which group and sorted in each list independently from 1 to n

i dont think thats the reason here its working properly when im using only one assembly

what does the error say?

and could you pin the outputs in the grouping and sorting by lengths group, so we can see what happens

thats for 1 assembly


thats fro multiple

In our company were using russian language in interface, so i cant provide you text in english

remove the math.round node.

as @staylor said. the different lengths aren’t round (ex. 259.00007) but when you round it, dynamo doesnt see it as the same input. thats why your error (chatgpt for the win) says that the keys input do not match (259.0007 ≠ 259)

1 Like

now its showing other error

Check the Get Parameter Value By Name list to see if there are any nulls or empty returns.


no nulls or empties

Visually check the list to verify. The Object.IsNull will show false positive results for certain things.

EDIT:

I will check later, when get home, thanks