Unfortunately to no avail. The field was already empty. I reattached the corresponding part and removed it again, but didn't solve the issue.
However, what I found out it is indeed the other type of views, in this case several Section Views, which have the number occupied under the hood.
A method I used to rename the views:
1 Delete the section view which blocks the name (keep in mind that this can be a view on on any of the other sheets as well. For instance, in my case, Section View H-H was holding Drawing View18 occupied)
2 Rename the view to the desired number.
3 CTRL-Z to bring back the deleted section view (the renamed view does not change back)
Martijn Heikens wrote:
There are macros to rename the views, section views, details views and sheets as well on this forum if you want to avoid the manual work and of course save time
A little examination under the hood using the API provides some clue here.
The name you see displayed for section views is not actually the name SolidWorks uses to keep track of them!
Interestingly enough, SolidWorks actually assigns section views with a good ol' DrawingView[X] number behind the scenes, even though it displays "Section View A-A" in the tree.
The "Name" property and GetName2 method both seem to return the same value. However, the help documentation for "GetName2" points to the GetUniqueName method to get the underlying real name for section views.
If you're really interested to see the actual names of those views, run this little macro from the VBA editor. It will show you the feature tree name and the real name for every view on the current sheet. Unfortunately, there's nothing you can do (as far as I can tell) to change the underlying name of the section views. If you really want your trees to be consistent, you'll have to start intentionally naming every view using an underscore or some other format so that you can avoid trying to overwrite section view "actual" names.
Dim swApp As Object
Dim swdwg As SldWorks.DrawingDoc
Dim swview As SldWorks.View
Set swApp = Application.SldWorks
Set swdwg = swApp.ActiveDoc
Set swview = swdwg.GetFirstView
While Not swview Is Nothing
Debug.Print swview.Name, swview.GetName2, swview.GetUniqueName
Set swview = swview.GetNextView