Select elements by category and workset

Dear Experts,
I was wondering if it is possible to select all elements by category and open workset (all elements which its workset is open on the project file).
By this way planing to speed up dynamo operation on the large project, if it is possible?

Thanks.

1 Like

hi @kvusal ,

Check it!

KR

Andreas

Thanks Draxl,
However was looking method to directly get elements by category and “open workset”.


Or this way @kvusal

@kvusal
The “open” workset changes as you change views right?


hahahaha… :slight_smile:
@kvusal @Marcel_Rijsmus

…GeniusLoci is everywhere :wink:

1 Like

I can’t keep up :slight_smile:
But that node has no inputs

2022-05-10_22h34_55
BUT the real magic has to do someone else :slight_smile: @Marcel_Rijsmus

import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import SimpleWorksetConfiguration
import System

OUT = System.Enum.GetValues(Autodesk.Revit.DB.SimpleWorksetConfiguration)

hmmm

KR

Andreas

For example, I mean Basement at this attached photo.

I am appreciate your effort.
However, i guess you misunderstood me. Let me explain task more comprehensibly:

  • We have a lot of 100 peaces of doors, 100 peaces of windows and etc. in our project.
  • 20 peace of door are in the basement, another 20 peace of door are in the Bina 1, another 20 peace of door are in the Bina 2, another 20 peace of door are in the Bina 3 and another 20 peace of door are in the Bina 4.
  • I want to get only doors which are at “basement” workset. (As you can see basement workset is open now.) Only 20 peaces of doors will be result.

If you don’t want to write your own code you can use something like GeniusLoci’s Collector of UserWorksets to determine which worksets are open. Then it’s just a matter of comparing values against the elements in your project.

3 Likes

Many Thanks Nick. Will try and come back to you.