Find Sheets with a Specific Legend on them

Hey All!

I am looking for a way to find a legend that is on multiple sheets and show the user via some kind of textbox of other indicator which sheets that legend is on. Is there a way to do this in Dynamo? I have not found any posts on this as of yet. Any feedback would be greatly appreciated.

I think you could do that by getting all elements on sheets and filter by name.
The text box can be done with dyna shapes, or a simple python script that displays a “warning dialogue box”

What have you tried so far?

2 Likes

Hi,

You can find in popular packages some useful nodes.
For example, there are the Sheet PlacedViews and the Collector of PlacedViews nodes in the Genius Loci package that will help you.

1 Like

This is what I have right now but it does not behave the way I would like. It does not list the sheets that have the legend on them. It just spits out views instead. I am not sure what I am doing wrong since I am pretty new to Dynamo.

@MDamon031 It is not possible to tell what is going wrong and where without seeing the output preview for each node. Please enable the output preview for each node and the post the screenshot.

@MDamon031 Have a look at this:


This is what it looks like on running (pressing Yes or No goes to the next sheet and cycles through all the sheets):
Search Legend

1 Like

Hi,

It could be easier with the Sheet PlacedViews node.

2 Likes

@Alban_de_Chasteigner Finding the views in a sheet is not the key problem here, it is to filter the sheets with a specific legend. I do have Genius Loci installed, but I’ll have to filter out the sheets with a particular legend in the same way regardless.

If you get legend name from here, then Equals (==) node, list Any true with the right list level, then filter boolean on the sheet list it will get the sheets as a list.

2 Likes

@SeanP Could be done, yes. I could use this method in my dyn as well, works fine.

Could also be done by getting the viewports on a sheet and filtering out the sheets with that particular legend viewport. Legends apparently don’t have the Sheet Name parameter filled in by default, but viewports containing those legends do.

All these methods are working, I checked.

This is not accurate. Legends are not treated like Schedules by Revit, Dynamo or any part of the API.

2 Likes

You are right, I was mistaken. I’ll edit the statement.

Thank you very much for the help on this. Is there a script behind that “Python Script” node that I would need to know?

@SrijanGautam Thank you for that add-in but I will need to know what that python script is you used or the add-in will not work.

I think it’s just a equals 0 script

You could use the ==node that finds true values for zero.
But I think Albans solution is faster.

@MDamon031 Use this script instead, it’s faster:


Search Legend.dyn (18.2 KB)

2 Likes

This works great!! Thank you so much.