Apply a saved view filter?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I've got a bunch of filter conditions (about 75) that I need to configure for a given view, with certain parameters. I'm thinking this should be fairly simple via the API. Basically the process is:
1. Add my pre-constructed view filters to the current view (Vis/Graph -> Filters -> Add)
2. Configure the visibility overrides for each filter (Filters - > Overrides)
3. Done
So, first question is: if I have a saved filter, say "Myfilter", how do I add it to the current view? I know it's via view.addfilter(), but I can't figure out how to get the ElementID parameter addfilter takes, for my filter based on its name. Or how to get a list (Ilist?) of the view filters available in the model, through which you could iterate and test for your desired name.
Second question, it would seem like an attractive option to simply create the filters I need from scratch. I've seen several examples in the SDK that cover creating view filters. Except that most of the examples simply filter on a built-in parameter (for example filter all the walls in the model). The parameter I need to filter on is a user-defined project parameter (not shared tho). How would you go about creating a filter based on one of these user-defined parameters?