Sheets find 'matching' Schedule to place on Sheet


I made this graph to place Schedules on Sheets, but i don’t like my approach.
Also i find it a bit ’ cluncky’ and unreliable. (basicly i ‘hope’ the length of my lists match).

What i really want is; let’s say i have a bunch of Sheets and Schedules,
and lets say i have Sheet 001 - apartment A, 002 - apartment B and 003 - apartment C and
Schedule apartment A, apartment B, apartment C among those Sheets and Schedules.
I want to create a list (in Dynamo) of Schedules based of the Sheet Names (for now)
So i end up with two lists so i can place a Schedule on the corresponding Sheet.
But i am kinda stuck / at a loss how to approach this. Can anyone point me at the right direction?
Maybe a topic or an example.

This is what i have.

Schedules.dyn (38.9 KB)

PS The Python is from Daniel_Woodcock1.

This is a great use for dictionaries.

Find all your Schedules, extract from them their identifier to which apartment they belong. Make a identifier - Schedule element Dictionay.

Then find all Sheets, extract the same identifier, ask the dictionary which schedule they need. Place.

Assuming your example names it can be something like this. You still would need to filter out all the non-relevant sheets/schedules.

I usually create temporary names for the schedules / views / sheets in order to more easily match data without typos.

For example:

In the end I may have 20 views which use this coding system:
Core 01_Level 01_Section 01 or Elevation 01

Then I can collect all of my views, split the view names with the “_” and process / group elements as necessary. When creating sheets, I use a temporary number in order to build the sheets. Then I go through with either a dictionary or a pre-defined script to find and replace text.

For example:
I group all of my views which start with “C02_L01” and use the key to place them on sheet “C02_L01.”

Afterwards, I run a script which changes “CO2_L01” as a key to a dictionary or an excel list value.

I also recommend creating separate scripts for each step in the process and numbering them sequentially in the name. It get’s very messy trying to encapsulate everything into one script, and it also takes forever to run each script. Breaking it up into chunks will help you keep an overview and will definitely help with keeping the structure of your data-flow a bit tidier. Trouble-shooting scripts for unforseen errors also gets easier.

For example:

Apartments_01_Schedule Creation.dyn
Apartments_02_Create Placeholder Plans.dyn
Apartments_03_Place Schedules.dyn
Apartments_04_Fill Titleblock Data
Apartments_05_Renumber Sheets.dyn
Apartments_06_Rename Schedules.dyn