That is my problem. I have a macro that allows you to rename the drawing sheets by the name of the config inserted in this sheet. Until the 2016 version, it worked very well. I just upgraded to 2017 SP4.1 and it doesn't work properly anymore. It only changes the name of the 1st sheet.
And since I don't know anything about VB, I'm in a mess ...
The code runs as usual, it changes the name of the 1st sheet, moves on to the next sheets but does not change the name. He leaves the name already present.
I agree with gt22 but the easiest way would be to scroll the macro in step-by-step to see the behavior and add debug.print to check the contents of configname.
In addition, it would have been good to "zap" the basemap, scan only the views and stop processing once a value has been obtained on the configuration.
I confirm on the other hand that it works on 2016 without problem (even if not very clean in terms of code) and that in any theory Solidworks does not have fun removing the so-called obsolete functions so probable bug elsewhere or hardware/software incompatibility.
Hola, I'm dumped. I do not understand what you are talking about at all.
Can anyone fix this macro to work on SW17?
Here is the contents of the .swp file
Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim swDraw As SldWorks.DrawingDoc Dim swSheet As SldWorks.Sheet Dim swModelview2 As Configuration Dim vSheets As Variant Dim swView As SldWorks.View Dim Part As Object Dim i As Integer
Sub main()
'The template is located in the SW template drawing folder
Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc Set swDraw = swModel Dim ConfigName As String Dim bRet As Boolean Dim vSheetProps As Variant
vSheets = swDraw.GetSheetNames For i = 1 TB swDraw.GetSheetCount swDraw.ActivateSheet vSheets(i - 1) Set swSheet = swDraw.GetCurrentSheet
Count = swDraw.GetModelViewCount
Set swView = swDraw.GetFirstView
Do While Not swView Is Nothing ConfigName = swView.ReferencedConfiguration Set swView = swView.GetNextView Loop Set Part = swApp.ActiveDoc boolstatus = Part.SetupSheet5(swSheet.GetName, 12, 12, 2, 3, True, "a3 - iso - NND.slddrt", 0.42, 0.297, "Default", True) swSheet.SetName ConfigName