Filter by Boolean help

I have a working script (thanks to Paralax for providing a script and helpful article) that will tag all the revisions in an active view. I am trying to modify it to tag all the revision bubbles of a certain revision. I am able to pull all the revisions, but I can’t seem to get FilterByBoolMask to work. Can someone clue me to what I’m missing? I’ve tried a code block, a string, and a number. I’m assuming I’m not calling out the parameter type correctly, but what else can it be other than an integer or string?

Annotations-Place Rev Tags-AllViews_script.dyn (62.5 KB)

couldn’t seem to download your file.

but you could use string.contains or change the levels on item.contains.

i think the sort will give you the wrong results, as you are not sorting your elements.

2 Likes

Thanks! I figured it was probably something simple but couldn’t figure it out. Levels have tripped me up in the past. I will test this when I get to the office.

Hello, you tried a groupbykey

edit:

Cordially
christian.stan

Sounds like String.Contains is what you want, however this is for partial matches. The == node is likely what you’re really after as it’s an exact match.

The reason List.Contains isn’t working is because it is specifically checking the entire list. Does the list contain this value? Yes. That’s one boolean, so you filter only one element with the mask.

2 Likes

The == worked great, thanks for the suggestion. I have used it in the past as well, but didn’t think of it.

One last item that occurred to me was isolating the untagged clouds so I’m not re-tagging any. I tried the Element TaggedStatus node and it didn’t give me the output I expected. It says that all my clouds but one are not tagged, and the one it is saying isn’t tagged is tagged.

I did snoop the revision cloud and I can’t see any properties associated with it that would reference being tagged/not tagged. Am I not able to use this as a boolean?

Thanks

I’m not sure whether you misspoke or confused yourself here. You said “the one it is saying isn’t tagged is tagged” but that’s the one it says is tagged. As for how it’s determining this, I can’t say off the top of my head. I would recommend pulling the custom node apart to see if you can tell what it’s doing. If I remember correctly, I don’t think you can pull tag information directly from an element. I think you have to pull the element info from the tag, which would explain why you don’t see anything when snooping the cloud.

So I pulled all the revision clouds (334) and all of the revision cloud tags and the tagged elements (423). It’s weird that there are so many more tagged clouds than clouds, but shouldn’t I be able to compare these two lists to pull from that the comparison the clouds that aren’t tagged?

The error in the script is “Asked to convert non-convertible types”

If you run the graph more than once it will continue to tag previously tagged clouds, so you could definitely end up with duplicates. You may also end up with orphaned tags, which might be the reason for the error, otherwise I’m not really sure where you’d be getting “non-convertible types”.

I tend to use the dependent elements API methods quite a bit and Rhythm has those available (with category filtering).

So I would start with my base object, RevisionClouds, and work down from there.

2 Likes

So that definitely helped to narrow the list down to 20 which seems more likely. When I view the first bubble in the list it is still tagged. Also, I’m assuming it is an issue that the balcony bubble is 1st in the list for the views but it is like 11 on the list for the points. See the screenshot.

Could it have to do with the method they are tagged?

Lastly, I have double checked that all the nodes going into the create tag node have 20 items, but it is showing more than 20 instances when the script runs. I usually end up shutting down Revit and restarting to try and figure out what is going on.

link to script →
Annotations-Place Rev Tags-AllViews_script.dyn (62.8 KB)