The 2014 version of the Revit API documentation have 2 methods for SetVisibility, where one is now obsolete.
But you can notice that both methods have the same same, except for the ‘S’ in lower and upper case. As C# is case sensitive, the compiler understand which version your code is using, but as VB.NET is not case sensitive, the compiler gets confused and show a error message:
The error is: ‘setVisibility’ is ambiguous because multiple kinds of members with this name exist in class ‘Autodesk.Revit.DB.View’
One workaround, which is only required for VB.NET, can be:
Dim param(1) As Object
param(0) = cat
param(1) = False
doc.ActiveView.GetType().InvokeMember(
"SetVisibility",
Reflection.BindingFlags.InvokeMethod,
Nothing, doc.ActiveView, param)
The InvokeMember under the Type of the View will make sure the proper version is called (with ‘S’ in upper case).