Legend Delete/Place New Legend on Sheet

Expansion of original post here: http://dynamobim.org/forums/topic/insert-legend-in-sheet/

I’ve modified the script posted (Thank you!) but ran into some trouble. I’ve got the legend i want being deleted (successfully) the legend i want being added (sort of successfully) The original script had the legend being added to ALL sheets. Where as i want the new legend to go the list of sheets that just had a legend removed. The goal here is to delete two old legend and replace with new one across 6 models with hundreds of sheets. I’m fairly certain its doesn’t like a simple list input for the “Place Legend on Sheet” node.

Thank you for all the help! I wish I had time to learn more coding!