For those of your who may be following this post, I've found a suitable solution to my puzzle by using View parameter "Visible in Option". The real purpose of this property is to limit the display of view tags, sections or elevations for example, to only views displaying the specified option. This property is useful if, say, you have duplicated a section view several times to display several different options. By setting each duplicated section's Visible in Option property, you keep your floor plans neater by not having several section lines stacked one atop the other.
But I digress. By default this property is set to "All" options, or null. Setting it to a valid Design Option ID has the bonus behavior of causing the View's Visibility Graphics Design Option override setting to also be set to the selected option with the happy result that my addin now does exactly what I want. Hurray!
You need to get the ElementID of the Design Option you want to assign. Then you need a reference to the View. Be aware that not all views have this property, so plan accordingly. Here's the relevant example code:
// Set the View's Visible in Option Property:
Parameter myParameter =
myView.get_Parameter(BuiltInParameter.VIEWER_OPTION_VISIBILITY) as Parameter;
// Some views don't have "visible in option" property (e.g.: Schedule)
if (null != myParameter)
{
myParameter.Set(opt.Id);
// Use the following statement to set the View's Visible in Option property back to "All"
//myParameter.Set(new ElementId(BuiltInParameter.INVALID));
}
Now, for the segment where I offer credit where credit is due: I found the key to my puzzle on Harry Mattison's Boost Your BIM blog. Check it out. He has lots of good stuff. Thanks, Harry!
Trevor Taylor
ZGF Architects