Create front view legend window

Hello! I am tring to develop a script that can make automatic legends for any element. I used a script that I found on this forum and then I personalized it. Now I am trying to create front views for windows to make their own legend. Does anyone know hot to do this?

Thank you

Automatic legend.dyn (48.7 KB)

If you use Genius Loci, then it need one component in the legend you copy… if that component its set to front your new component will show as front as well, you can just delete the one component in the run as well…hope it make sense

Yes, it works but not on windows… it gives me “Error”.

The selected component is not visible in the selected view.

Hi @gabriele.potenza1 not sure, it should work on windows as well…

Could you please share this file?

not sure i have it anymore…im back on my dyn labtop in a hour or so and will see i can find it in my bin

just found a script that works. I will fix mine with this one. Thanks for your precious help

Thats great :wink: here is my example if you need

legendtest.dyn (31.6 KB)

Maybe this short video can help You… i created it 2 weeks ago :slight_smile:
Legend Components in Revit- How to change view direction with Dynamo - YouTube

this is the latest version that I would like to share with you. Thanks @sovitek for your help and @KamilR.
First create the views and their name, second create at least one element in its specific view. Then play the file and enjoy. Hope this could be helpful for anyone who will read this post

Automatic legend.dyn (131.3 KB)

Thats great, thats what i actuelly try to show in my example :wink: :wink:

hi sir, for some reason the script will not work for me , and it shows null! it doesnt create the legends at all !

hard to say , it need one legend component already placed as i guees is descriped in the node as well, if that doesnt work. you can use copy by vector as well clockwork should have one

yes it already have one legend component already placed there

open the node and copy python to canvas and see what you get

or you can try copy by vector and just set the family type after


Home.dyn (18.5 KB)

but in this script i need to have all window already in the legend no?

yes still need one legend component here as in genius loci node

dont think its possible without, with API so just have a legend with one component in your template you copy , and delete the temp component when have created the new…guess its the only way