Of course tags have valid worksets, in a workset enabled project:
Instance workset is the view, type workset is the tag’s family.
The entire point of what I need to do is find tags with a specific instance Worsket, because that is where you can tell in what view the tags are located.
Visibility in view includes only tags within the view boundaries, however (as all you Revit veterans must know), it is very easy to find hundreds of tags beyond the view boundaries, after dozen of people worked on a large project for months.
This is the cleaning I trying to do, and I can do it with OOTB tools (mainly: select all instances in project, save selection and then remove from selection set the tags that I wish to keep. Then, delete tags in resulting selection set).
It worked for stair paths (we had over 18,000 instances, while we needed only a few hundreds), but wall and door tags are too many and dispersed in too many views, so I was trying to save time using dynamo.
Which does not save time at all, but it does make you feel really good when the script finally works as expected.
Now, I begun my script on a test project, and it worked great, as expected:
then tried on the actual project, and the All Elements of category would fail. Hence, I spent hours debugging and finding alternative solutions, but the issue must be numbers and dynamo, because several nodes involved with getting the instances of the tags, fail or return the tag’s type, instead (see previous screenshots…)
It’s hard to say, if it is a mater of number of tags, and what that number is, because I cannot recreate a project with thousands of tags just to test the damn thing. I don’t get paid to do this work, I am not a programmer or beta tester…