Set Worksets from a Shared Parameter

Hello and thank you in advance for the help.

I am trying to set the worksets in my project based on a shared Parameter, in my case is “NAME ID”, I have already defined the shared parameter in the project in all the elements that I want to separate by worksets. But I cannot get to change the worksets based on that parameter. To provide a bit of context we do sequencing and first we name all the elements, and after that we divide in workset to present in a meeting and turn on and off as the Construction team needs. I am attaching the Screenshot. I am a new user so I cannot attach the .dyn.

Thank you very much

Hi @AlexiMonge1987 ,

It sounds like you want to create a script which overrides the parameter-value of your element’s workset to match the parameter-value of its’ “NAME ID” parameter-value. If this is the case, try something like this:


2022-07-25 Set Workset as Parametervalue.dyn (15.0 KB)

Hello @Daan , that is exactly what I want to achieve, I run your script but in the workset By name node all the values are null. and in revit I do not see any changes in the worksets. It might be because I do not have the worksets with that name created in Revit, and I need to create the worksets with the paremeter “NAME ID” first?

Yes.

You could also use Dynamo to created the Workset first (in the same .dyn) :grin:. Rhythm got a node for that.

NB
You might need the Passthrough node when you also want to create a Workset first before placing the Elements in the created Workset.

Hello @bvs1982 I added the node create worksets and I have created all the worksets that I need. I did not understand what did you mean with the passthough node or if I applied correctly. The thing is that the worksets are still not getting renamed with the parameter value. What do you think it went wrong?

Not 100% sure but maybe you need to feed the Id instead of Workset.

At first glance you applied the PassThrough correctly.

Also i thought you wanted to place the Elements on the corresponding Worksets? Not rename them?

Maybe have a look here?

As i currently don’t have access to Dynamo I can’t check what the nodes need as an input.

my goal is to rename the worksets, with the Parameter “Name ID” , in my office first we define the naming convention and after that we create the worksets. in this exercise I have 300 worksets that we use for sequencing.
I am attaching a view with the .dyn a bit more open.

To be honest i don’t think this is what Worksets
should be used for. Maybe it is better to re-think your workflow (instead if creating 300+ ! Worksets).

That being said.

If you want to stick to this workflow the Create Workset node might need a String as input?

In that I agree with you. But it is the procedure that the company follows and I did not want to change the procedures during my probation. I will try to get another approach

I do not follow what what string should I add

String from Object node after the Element.GetParameterValueByName node and before the Create Workset node.

I know there were some issues with creating Worksets in the past (older
Revit version like 2015).

It did not work. there must be something that I am missing or I do not have the knowledge yet, I am using Revit 2021

I’ll hop on a PC real quick.

@AlexiMonge1987
It looks like it only works when you created ONE Workset manually first.
I guess that got something to do with the dialogue box you get the first time you create a Workset (so Worksets get enabled).

In order to work I have to delete first all the worksets that I have created before?

Hmmz, if you already created Worksets once already (manually?), then you might need to filter out the ones that already excist?

If that’s is not the solution, then i run out of ideas. Or i might miss something myself.

Well I really much appreciate the help and I will post The solutions if one day I actually solve it, I will let you know. Thank you very much for trying.

I am (was) pretty sure it should work…

I’ll look into it tomorrow again if there isn’t a solution yet. Now time for bed :stuck_out_tongue_winking_eye: :sleeping:.

I will start a new test project later today and see if it works, maybe I have way to many information in the project already.

Silly question, but is worksharing enabled in the project? If not you’ll need to do that first, then run the Dynamo graph.

Hello @jacob.small it is enabled it is a current project we are worksharing in the office.