Using Dynamo to Automate Worksets of Elements

Hello Guys,

I’m trying to create a string to automate the process of choosing the workset of elements, sometimes we work in a fast pace and forget [or intentionally ignore] changing the workset we are placing elements in, just to do the cleanup later, if we have the time.

I tried the setup in the image below but it didnt work, maybe I need to change the type of the input for Element.SetWorkset node ?

FYI i’m still new at dynamo

1 Like

Hi @mhasafa

Welcome to the Forum!

Do you have the workset (Furniture) in your model. If not Before you assign them you should create them first. There are many custom nodes to create worksets. One of them is “WorksetByName” from archi-lab package.

Good Luck!

Thank for your reply, yes I had the workset in the model.

I figured out why it was not working, worksets in revit have ID’s [numbers] , and using the workset name as input will not work, you first need to extract that ID then use it as input.

Now I have another issue, its kind of nods efficiency, as you know worksets may contain more than one type of category, if you look at the snap shot below, you will see that, in my case, the workset “interiors” contain rooms, room separation lines and walls, but Element.SetParameter.ByName only accept one input, I need to find a way, to gather all these elements in one container node then link it to"elements" any thought on how to do that ?

Thanks
Moe

If they are to all go to the same workset just put all the elements into a “list.join” node, also make sure it is “flatterned” then put it into “element.setparameterbyname” element slot.

1 Like

Thanks Brendan,

I used List.join and its working find, I’m not sure why I need to flatten the list, its working without it.

2 Likes

I think you don’t need the list.create nodes, the output of the all elements of category node is a list already.

I agree just put the elements into the list.join node without the list create nodes

1 Like

Thanks for the tip.

Thanks for the advice. another question, what is a recommended approach to filter a category, for example, casework category contains millwork which will live in “Interior” workset, and it also contains modular casework which lives in “Lab Casework” work set ? how would you approach this ?

Thanks

Maybe create a shared parameter called something like “Usage” and define it inside each family as “interior” or “lab” and then use this parameter to filter.

Or use the room in which the furniture is located to filter to the correct workset. You can read the rooms for furniture and some other categories, don’t know if it is possible for every category you need to filter.

Hi there!

I have been able to create the script.

I simply did this.

Capture
I hope you all can use it.

2 Likes