Sorting columns based on x and y points seem to end up in random order

Hello all,

I am trying to make a workflow that automatically changes the mark value of all structural columns in my view based on their location( Top left to bottom right.)
I think i am missing something since the renaming is done incorrectly now.

@Kulkul I am adding you here since i based the script of a solution you gave to another user. ( Rename elements (beams,columns etc.) by X and Y direction ) but this was a 3 year old post so i didnt know if i should bump that again…

There is probably something im not seeing that makes dynamo sort the columns the wrong way.

Anyway, here is my workflow: (edited because i saw an error in my workflow.) Now the sort node gives the following error:

Warning: List.SortByKey operation failed.
Number of items does not match the number of keys.

And this is how my columns end up being renamed:(DISRECARD THIS OUTCOME SINCE THE WORKFLOW DOESNT WORK AFTER MY LAST EDIT.
(in red how i would like the columns to be renamed)

image

The point.x list is flat whereas the list with elements is grouped.

Try to match the point.x list by using list levels there.

1 Like

I am not sure what node you are talking about…
Could you elaborate?

I added a list flatten to the second point node and i got the script almost working i guess…

The problem now is that the columns get named from bottom to top instead from top to bottom…


image

There seems to be more going on than just inverse numbering. I added a few columns and made the name a number instead of a letter


sortGroup.dyn (23.0 KB)
sortGroup

This should work for you.
Though in a project with multiple levels you’ll need to group by levels too.

Thank you for your reply!

There seems to be a problem with my sory by key node, it gives me the following error message:
Warning: List.SortByKey operation failed.
One or more input types are not matching. Lists as keys are not supported.

I believe i recreated your workflow, but i did notice the difference in your sort node and mine, is this a version difference?

Nevermind, i didnt know you can select Use levels on those nodes…
Thanks for the help, i got the workflow working! :slight_smile:

1 Like