Thank you for your detailed answer. I like your approach. I'll see if I can port it over to my code, and make this work. I have a few questions.
What does this line mean:
// create new ViewFamilyType without ViewTemplate
ViewFamilyType my_type = viewFamilyType.Duplicate("Error_View") as ViewFamilyType;
my_type.get_Parameter(BuiltInParameter.DEFAULT_VIEW_TEMPLATE).Set(ElementId.InvalidElementId);
I looks like we are duplicating the "first" view found via the filter criteria further up the code, so the file is basically taking an existing view and duplicating it. Is that better than the "Create" method?
Then you are getting a parameter and setting it to an ElementId enumeration of invalid element? Why? Is ElementId.InvalidElementId not an enumeration?
view.get_Parameter(BuiltInParameter.VIEW_PARTS_VISIBILITY).Set(2);
What is this line doing exactly? Why "2?"
I like this line:
IEnumerable<Element> elemsInView = new FilteredElementCollector(doc,view.Id)
.WhereElementIsNotElementType()
.Excluding(errorIds);
I see what you do later with checking the elements to make sure they are eligible for "hiding." Too bad the filter can't have a ".CanBeHidden()" suffix to eliminate that. But I'm sure it doesn't require a lot resources.
All of this is really good. I'll try it out. Aside from the "view.get_Parameter(BuiltInParameter...." coding, I have seen most of what you are providing, but never employed it in that way. Much smarter looping and filtering in your suggestion than my original code, but I'm still negotiating how Revit works.