Copy contents from drafting to legend

Hello,

I have built a script to copy all of the elements from a drafting view to a legend view. I have created blank legend view (just one) to use as a template and a duplication item. I duplicate the legend and name it according to the relevant drafting view. That part works.
Now I am trying to copy the contents from the drafting view and place it on the corresponding legend view, but this is not working. This is what I have so far.

Could anyone tell me what I am missing?

Is this just an exercise you want to figure out? or a need? The reason i asked, is that, PYREVIT already have this tool and vice versa.

Thanks Cesar, I didn’t know that this tool was built into PyRevit. I did build the tool anyway, so it was a good learning experience :slight_smile:
Thanks for the response.

Now for me… i also want to learn how you did it… share the love? a screenshot of the script?

Sure, here is the script.
You need to create a default legend view to use as a template. Just create a legend view and leave all the info exactly as it appears, dont change anything (Name, scale etc.). Then it should work no problem. I also put a limit on the number of drafting views you can select at once, you can change this if you like.
drafting to legend.dyn (133.5 KB)

thank you