Dynamo - Python Placing a Legend on Multiple Sheets

Hi @GavinCrump
in one of your video tutorials about placing views on sheets, I tried to do the same approach for placing a legend view on multiple sheets but in this case, there’s only one legend view which I want to place on multiple sheets and the python script in dynamo isn’t functional anymore. I can’t understand how to tell python to place the very same Legend View on all other sheets.
Here’s a screenshot of the situation I’ve got. I would appreciate it if you could help me understand the problem.

Hi,

What does the error say in the small bubble above the node?

It gives me the following warning:

Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 40, in
IndexError: index out of range: 3

Could you copy paste your python code?

Where did you find this code?

I followed the video tutorial by @GavinCrump
You can find the video and python code within the video in the link below:

@GavinCrump I also use your Node for Viewports.CreateByPoints for placing multiple views on sheets but I fail to do so. Here is what I use as inputs in the picture below. Would appreciate it if you could help me on that too. It only places the views on one sheet.


a

If you need a quick win, pyRevit has this function.
But I can understand wanting to know why this approach isn’t working.

If it’s placing all views on only one sheet, then you will probably need to adjust the level of the sheet input as shown below and/or you may need to set the lacing.

image

Welcome to the Revit API, where nothing works how you’d expect!

Legends are an exception and cannot be created like schedules and views. Instead the only method I know of is copying them from view to view using this method:

It will not work the same way as my tutorial.