Duplicate legend and rename duplicated legend with sheet number

I have been lurking on the forum trying to gather information in preparation for my leap into creating my first dynamo script. I would like to start by being able to duplicate a generic legend based on the number of sheets created in Revit. For example I have a project that will utilize a standard generic legend that needs to get copied to each sheet. However as the project develops the legend will need to be altered specific to that sheet. So I would like to start by just figuring out how to duplicate a generic legend based on a sheet list. So if I have sheet A101, A102, and A103, then I would duplicate the generic legend to be Legend-A101, Legend-A102, and Legend-A103. I am not sure what nodes to start out with. Any guidance to point me into a direction or packages that I can download into dynamo to help with this is greatly appreciated.

Welcome to the forum! This could help to get started:

Thank you for your reply. I have already came across this and download it to try and familiarize myself with it. However i can not figure out the duplication of the legends. This script appears to put a specified list of schedules/ legends on multiple sheets that are created in the project. Very useful and I hope to incorporate that functionality to what I need in the future. I just want to take it one step at a time and create a script that will duplicate a legend based off a sheet list. Then as I figure that out then build on that and add additional functionality. Again thank you for the reply and information, greatly appreciated.

Hi @dmillerSNYXQ,

As far as I’m aware you can create or modify legends via the API - therefore you can’t do this in Dynamo either.

You can most like duplicate the view and rename via the same way you would any other view - search the forum for duplicating views.

But without being able to modify legends your workflow may not be viable.

Cheers,
Dan

1 Like

So if I am understanding correctly I should be able to duplicate a legend view, and the process should be similar process as duplicating a floor plan view in dynamo. Thanks for the help.

Hi @dmillerSNYXQ,

Yes, you can Duplicate a legend, but you can’t modify the Elements within the View. I really wish you could, however a workaround is to use Drafting Views. these you can modify as you wish, I needed to dynamically create a hatching legend which was view specific so created the legend in dynamo and baked into a Drafting View. It’s a bit fiddly but it worked nicely.

Cheers,
Dan

Ok thanks. I can work with just duplicating the legend views for now. Still would be a time saver for this project and gives me an opportunity to learn. As my skill develops I can look into other workflows as described. Still trying to figure out even how to duplicate a view. Going go look on this forum and other sites to see if I can at a minimal duplicate the legends.

OK I have managed to get a working file that duplicates the legend views; however I would like to be able to add a prefix to the final legend names. I have struggled with getting this part. Any help appreciated. I did not screen capture my attempts at adding the prefix. I am just showing what is working and hope some one can guide me how to properly get a prefix added to the final legends name.

Success!! I got it. Thanks for all the help.

2 Likes