Extracting Workset Names and their associated ID numbers with Dynamo

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