Count the number of Workset

Hi,

I’ve created a Dynamo 2.3 graph for extracting information from projects in different Revit versions. However, I have some issues with nodes that are no longer compatible with the newer version, Dynamo 2.13. Specifically, the instruction “Workset.GetAll” seems to be outdated.

To streamline my workflow, I prefer maintaining a single version of the graph. The challenge is ensuring compatibility with both Dynamo 2.3 and 2.13 across various Revit projects.

Is there a way to count the total number of worksets that are compatible with both Dynamo 2.3 and 2.13 without relying on additional packages ?

Thank you

What is the error message saying ? Workset.GetAll() is working fine for me in Dynamo 2.18

image

I’m not truly savvy on all the ins and outs, but I believe the error is because you have multiple packages installed that utilize the Workset.GetAll function. So it’s asking for you to verify which package to use. That’s something with 2.13.
Example would be “archilab.Workset.GetAll()”. This works for 2.3 to 2.13 as long as you have the package installed in all versions.

EDIT
@haganjake2 this is probably the error message being returned

image
image

1 Like

Hi @haganjake2, @staylor.

This is the message:

That should be the error from the List.Count node. @haganjake2 was asking for the error from the Code Block that’s calling up the worksets.

That’s the warning from the code block normally.

When I start writing in the codeblock of the 2.13 version the keyword “workset” is not proposed.
image

@staylor already explained that you either have duplicate namespaces which means Dynamo doesn’t know where Workset is coming from and why it doesn’t show up in DesignScript or you don’t have the package installed. You need to confirm the correct package is installed and then provide the namespace.

1 Like

Hi,

I have created a python node based on the code of @ksobon:

I only need to collect the number of worksets.

Thank you all.