Run All Elements of Category on Multiple Categories

Hi all,

I’m an extreme beginner to Dynamo and I’m trying to run my first script. I need to filter my schedules in Revit by Worksets, and I was following this video from Aussie BIM Guru to do that. Schedule Element Worksets using Dynamo! - YouTube

I got the script to work and populate the “Manual Workset” parameter just like the video, but I would like it to include multiple categories at the same time, instead of only 1.

This is probably easy but I don’t really know anything about dynamo.

Thanks

1 Like

You can feed a list into the All Elements of Category node. You can either do this by using multiple category drop-down boxes and a List.Join node, or write a list of text strings of your categories, then use Category.ByName.

Thanks Hamish,

It looks like it’s working to feed 2 categories into the All Elements of Category node, but when I send it to the Element.Group and Element.Workset nodes the list says null.

I suspect that’s caused by the list’s nesting. All Elements of Category is generating different sublists for each category you input, so you now have 3 levels of lists, whereas if you input a single category rather than a list of categories, you’d only have 2 list levels. Instead of checking for the workset of the item in the list, it’s instead trying to find the workset of the list itself.

If you don’t need to keep your categories seperate, you could just flatten your list of elements. If it would be useful to keep them seperate (e.g. ceilings and walls go on different worksets), then clicking on the little arrow next to the input on your Element.Group and Element.Workset nodes and changing them to @ Level 2 should do the trick.

Flattening the list worked for the Element.Workset node but I’m still getting null on Element.Group

Are all of those elements in groups? If not then that’ll be why they’re returning null.

Thanks Hamish. You’re right, those elements aren’t all in groups. It looks like it’s working.