Replace lists of varying lengths with other lists of equal length

Hi, I’m trying to place multiple views on multiple sheets. Depending on the sheet name, multiple views ranging from 5 to 7 views are placed on each sheet.

The coordinates of the views on the sheets change depending on how many views are on the sheets. Therefore, sheets with 5 views will always have the same coordinates, sheets with 6 views will have the same coordinates, and so on.

I have created 3 lists of 5, 6 and 7 XYZ coordinates.

The problem… I can’t figure out how to assign the coordinate lists to the corresponding list of views.

View List Length 7 = Coordinate List Length 7
View List Length 6 = Coordinate List Length 6
View List Length 5 = Coordinate List Length 5

I’ve played around with the idea of counting the view list length and dictionaries to replace the count number with a list, but to no avail.

The image is very simplified. I will have hundreds of sheets where I need to place 5 to 7 views on each sheet, and as previously mentioned at coordinates unique to the view quantity.

Any guidance would be highly appreciated.

Hi @Jwill ,

I would use 1 dictionary where you store all your X- and Y-values, organised per expected view amount making it so that you can easily retrieve the right amount and that editing your coordinate list only is in 1 place:

2025-01-19 Retrieve list of Coordinates by list.count output.dyn (15.9 KB)

1 Like

Wow thanks a lot for the reply Daan!
This was the last part of my graph and everything works now. I’m going to have to learn more about dictionaries and how to apply them to different problems!
Now to try this for hundreds of sheets and views.

1 Like