Turn off RVT Links in Revit 2018 - Doesn't update the Visibility Graphics Setting

This code works for turning off the RVT Links Category in Revit, however the checkbox in Visibility Graphics isn’t getting updated. Probably because it isn’t turning off the specific link visibility in the view. Any thoughts:

categories = doc.Settings.Categories
for c in categories: 
    #print c.Name
    if c.Name == "RVT Links":
        #print c.Name
        selectedcat = c

for v in selectedviews:
    catId = selectedcat.Id
    try:
        v.SetCategoryHidden(catId, not bool) #Revit 2017, 2018 specific method
        print v.Title + " - " + selectedcat.Name + " Success"
    except:
        print v.Title + " - " + selectedcat.Name + " Failed"
        pass

Sorry to dig up an old thread but in 2021 this is still the case. I turned off revit links with Dynamo and the turn turn off in the views with that template but the check box in the template is still turned on. This could be very confusing for users. Also without dynamo I can’t see how turn the link back on.