# Extracting Workset Names and their associated ID numbers with Dynamo

**URL:** <https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931>\
**Category:** Packages\
**Created:** [August 5, 2015, 10:29am UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931 "2015-08-05T10:29:30Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garret\_Meierbachtol](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@Garret\_Meierbachtol](https://forum.dynamobim.com/u/Garret_Meierbachtol)\
**Post date:** [August 5, 2015, 10:29am UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/1 "2015-08-05T10:29:30Z")

</div>

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!

Thanks

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [August 5, 2015, 10:31am UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/2 "2015-08-05T10:31:01Z")

</div>

![2015-08-05_09h58_31](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/2/23b8e67b0282f37d564279416af2b31096595844.png)

---

<div class="post-metadata">

**Author:** ![Garret\_Meierbachtol](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@Garret\_Meierbachtol](https://forum.dynamobim.com/u/Garret_Meierbachtol)\
**Post date:** [August 5, 2015, 10:31am UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/3 "2015-08-05T10:31:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Garret\_Meierbachtol](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@Garret\_Meierbachtol](https://forum.dynamobim.com/u/Garret_Meierbachtol)\
**Post date:** [August 5, 2015, 10:34am UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/4 "2015-08-05T10:34:27Z")

</div>

Thanks again John, that worked perfectly!

---

<div class="post-metadata">

**Author:** ![Hiranga\_Goonawardena](https://avatars.discourse-cdn.com/v4/letter/h/6de8d8/32.png) [@Hiranga\_Goonawardena](https://forum.dynamobim.com/u/Hiranga_Goonawardena)\
**Post date:** [August 10, 2015, 1:32am UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/5 "2015-08-10T01:32:56Z")

</div>

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??

&nbsp;

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

---

<div class="post-metadata">

**Author:** ![Garret\_Meierbachtol](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@Garret\_Meierbachtol](https://forum.dynamobim.com/u/Garret_Meierbachtol)\
**Post date:** [August 10, 2015, 7:07am UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/6 "2015-08-10T07:07:45Z")

</div>

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](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/1/1b55fdb5876373ec36572ffe92e56ec5d462e888.png)

---

<div class="post-metadata">

**Author:** ![Michael\_Ramsay](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Michael\_Ramsay](https://forum.dynamobim.com/u/Michael_Ramsay)\
**Post date:** [August 10, 2015, 12:22pm UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/7 "2015-08-10T12:22:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Garret\_Meierbachtol](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@Garret\_Meierbachtol](https://forum.dynamobim.com/u/Garret_Meierbachtol)\
**Post date:** [August 11, 2015, 7:37am UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/8 "2015-08-11T07:37:34Z")

</div>

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](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/0/07963c92c2312174c414e61d6f855289f2630477.png)

---

<div class="post-metadata">

**Author:** ![Michael\_Ramsay](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Michael\_Ramsay](https://forum.dynamobim.com/u/Michael_Ramsay)\
**Post date:** [August 11, 2015, 2:05pm UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/9 "2015-08-11T14:05:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Garret\_Meierbachtol](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@Garret\_Meierbachtol](https://forum.dynamobim.com/u/Garret_Meierbachtol)\
**Post date:** [August 14, 2015, 9:04am UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/10 "2015-08-14T09:04:28Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Michael\_Ramsay](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@Michael\_Ramsay](https://forum.dynamobim.com/u/Michael_Ramsay)\
**Post date:** [August 14, 2015, 4:11pm UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/11 "2015-08-14T16:11:48Z")

</div>

Great, I’ll share my progress too.

---

<div class="post-metadata">

**Author:** ![john\_pierson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/john_pierson/32/191977_2.png) [@john\_pierson](https://forum.dynamobim.com/u/john_pierson)\
**Post date:** [August 14, 2015, 10:18pm UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/12 "2015-08-14T22:18:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Luke\_Johnson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/luke_johnson/32/9473_2.png) [@Luke\_Johnson](https://forum.dynamobim.com/u/Luke_Johnson)\
**Post date:** [August 27, 2015, 7:33pm UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/13 "2015-08-27T19:33:52Z")

</div>

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!

&nbsp;

![worksetFilter2](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/2X/b/bdb86e5169814deb8c7ff933c6af39165bbf54a4.png)

---

<div class="post-metadata">

**Author:** ![Mark\_Drotar](https://avatars.discourse-cdn.com/v4/letter/m/9d8465/32.png) [@Mark\_Drotar](https://forum.dynamobim.com/u/Mark_Drotar)\
**Post date:** [January 14, 2016, 1:20pm UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/14 "2016-01-14T13:20:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LTark\_dim](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@LTark\_dim](https://forum.dynamobim.com/u/LTark_dim)\
**Post date:** [March 16, 2018, 9:41am UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/15 "2018-03-16T09:41:09Z")

</div>

Hi Luke,

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

**FYI**  
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.

 ![Display%20worksets%20of%20element%20in%20multiple%20linked%20rvt%20models](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/f/2f08f3bb1c76696e7aac99f134a53cd186472ec9.png)

---

<div class="post-metadata">

**Author:** ![aronreis](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/aronreis/32/80390_2.png) [@aronreis](https://forum.dynamobim.com/u/aronreis)\
**Post date:** [November 5, 2019, 4:17pm UTC](https://forum.dynamobim.com/t/extracting-workset-names-and-their-associated-id-numbers-with-dynamo/1931/16 "2019-11-05T16:17:44Z")

</div>

> [@Garret\_Meierbachtol](#):
>
> anks Jo

This is information save my life today.
