Setting Workset by element with specific parameter

I am trying to set all elements from different categories into their corresponding workset with the script below.

However, the script is showing the error in the image and I have not got a clue how to sort it out.
I want only the element with the parameter “4.Level” = BH-10 to be set to the Workset “Level 10”

Could anyone please let me know what am I doing wrong?

You need to supply the elements to the SetParameterByName node.
What you seem to be doing is input the True/False that you checked for.

Use FilterByBoolMask node to filter out the elements as needed and that should do the trick.

Hi @AmolShah,

I have tried your method with the BoolMask but now it has given me a different error.

Can you show us the output preview of the List.Flatten and Workset.Id node?

@AmolShah, the WorksetID

And the List.Flatten

I don’t know if it is worth mentioning the Worksets and the Workset.ID are Orchid

It was worth mentioning @JocoYo, thank you for the info.

I would suggest using nodes from archilab

Or alternatively you can edit the code block to

@AmolShah, The same error as the last time with the “List.Flatten(item, -1)”.

What is the difference between the Orchid “Flatten([item])” and the “List.Flatten(item, -1)”?

Flatten was being used with earlier version of Dynamo
Now it has changed to List.Flatten for Dynamo 2.0.x

Can you try the archilab nodes?
If that doesn’t work our then it would be great if you could share your files so we can take a look at it.

@AmolShah, The archilab I have found does not seem to have workset nodes

And I have downloaded today.
Is this the wrong package?

Seems like they moved/removed it in the latest version.
Instead try this:
Use the Worksets node from Orchid and connect it to the code block to get the Id.

1 Like

@AmolShah unfortunately the code block you have written has not worked. However, Orchid has a workset.ID node and understanding the value would need an ID (thanks to you) I have placed it and it has worked beautifully.

Thank you for your help. Would not have been able to make it otherwise :wink:

1 Like