Applying view filters to views

Due to limitations of Steel Connections and Assemblies, I’m forced to do a workaround to detail my steel members that involves creating filters for every steel assembly. I have a shared parameter “3i_G_ASSEMBLY_ID” on my steel elements and section marks, and I am using filters to hide anything that does not contain the matching ID from each view. My ID values are “S101A”, “S101B”, etc. The View filters will use identical naming as the parameter values.

For my view filter creation, I believe I have a fully functional code now to automatically generate all filters. For now, I’m handling this code separately from the next portion.

The next step I’d like to take is where I’m getting hung up. I’d like to take all of these filters and apply them to the views. In theory, the view filter name should be identical to the 3i_G_ASSEMBLY_ID parameter value, so I need to figure out how to map these together. What you see in the following is me listing all of my views, then filtering out the ones that are not related to an assembly. And at the end, I’ve got the “set view filter” node… but I am not sure how to get from point A to B. I cannot seem to find a way to access the view filter names, and when I do, I’m not sure how to map them to the matching parameter value. Any ideas?

For what it’s worth, here’s the code I used to generate all of my view filters. The yellow box at the end is warning me that I already have filters by the same name. It appears that this is not a problem when I run with the Dynamo Player, but if I run from the Dynamo Editor, it doesn’t work. If anybody knows how to fix that error, it would be nice but it’s not my primary concern.

Update: I think I figured it out. This appears to be working correctly.

If anybody has a solution to the error I get in the other code (post #2 on this thread) for filters that already exist, please let me know. That’s my next biggest issue.

1 Like