Renumbering windows

Hi fam,

I’m trying to create a graph that lets me re-number windows when one is inserted in a project. I use the mark value as the window number tag and have hit a hurdle at the Element.SetParameterByName node.

I think the issue is that I have had to change the mark values from strings to numbers to sort the list and increase by 1 but I cant for the life of me figure out how to keep the windows as elements without losing my list order and more importantly my list slice.

I’m sure this is something simple for someone but I’m slowly learning dynamo so any assistance is greatly appreciated.

Renumber Windows.dyn (22.2 KB)

List.SortByKey will allow you to sort the elements by their number, rather than sorting only the numbers.