Extracting Workset Names and their associated ID numbers with Dynamo

Hello All!

I’m working on a script to go through my project and push elements of given categories to the “correct” worksets. However, to get that to work the way I want it to, I need the workset ID numbers. So, I was wondering if anybody knows of a way to easily extract that data from my Revit project using Dynamo. I previously tried using the Getworksets package, but it appears to be no longer functioning, and as a newcomer to python and Dynamo, I don’t have those skills developed quite yet to troubleshoot effectively on my own.

Having said all that, any and all input/guidance is appreciated!



Fantastic, thanks John, I’ll give it a shot!

Thanks again John, that worked perfectly!

Hi Garret, I’ve been trying to accomplish something similar using this inside of Dynamo, how I was uncertain as to one of the nodes I’m using is function or not. Are you using a node, or a custom script??


Node in query is SetWorkset. Heard of anything like this?

To get the data I was after I am using the node that John referenced in the above post. My resulting dynamo script ended up looking like this (see screenshot). I then took that data to apply the appropriate workset to various items throughout the model. It is more or less a standards enforcement tool.

workset check

How are you pulling the data from the workset information? I try to manipulate the “list” and i get an error saying it’s a string. I’d like to pull each workset from the list to feed another node.

For right now, that is still a manual process for me. Eventually I’d like to make it work by having a string node with the workset name in it that talks to an intermediate node that grabs the ID number for the workset based on the string input and then reports that ID number to a code block which then goes through and puts everything on the right workset. Like I said, right now the way I have my script set up, that ID number for the workset is still a manual input process, and I get that ID number from the little workset script pictured above. I’m doing this so that my BIM coordinators have a tool that they can use to quickly move every element in a model to the correct workset. Below is a screenshot of that basic structure. (I’m certain there are more eloquent solutions). Also, I can do this because every project we have starts from the same “startup” file, so the ID numbers for those worksets don’t change. If you start from scratch every time, that’s where the ID number based on your string input would really come into play.

piping workset change by system type

Yes, I’m trying to do something similar. We don’t have a standard workset naming strategy so that’s a problem. I’d like to grab the workset name from the worksets in the model, use it for the filter, and have a drop down list to pick the category

I’m working on something like that now. Once I get it complete I’ll post my solution…unless somebody beats me to the punch :slight_smile:

Great, I’ll share my progress too.

Looking forward to seeing the progress! Remember to post if you need anything!

You can use a combination of GetParameterValueByName, Flat List to List of Strings (in Bakery), If Equal Return Index and GetItemAtIndex to basically filter objects by the Workset that they are on. Sorry about the messy image!



Did anyone get anywhere with this or did it lead to a dead end? We were looking into trying to do this exact concept.

Hi Luke,

Would it be possible for you to post a larger image?

I am managing multiple models in wich I have to control the workset of different family instances (Generic model category eg.). I dont want to open each of them and do coordination views to check if the people modelling have placed this specific family on the correct workset. So I am also working on a solution to display the workset name of each instance. I cant make dynamo show the names yet as you can see.

The Element.WorksetName does not seem to work for me.
Any help would be much appreciated.

This is information save my life today.