Hello
I am looking for a charitable soul to help me make a program to change the configurations in the drawing. Let me explain.
I have a room with several configs, I have to make a plan for each config (so a different sheet for each config). I already have a macro to copy/paste the sheets, and a macro to rename the sheets (the same name as the name of the configs). Now I'm looking for a code to go through each sheet and change the reference configuration of the drawing according to the name of my sheet or directly according to the name of my config.
I found a macro on code stack but it does everything (copy/paste renames and changes config), I tried to modify it so that it just changes the config. So it works but only on the last sheet. I can't get curly on the leaves. In addition, I want the 3 steps to be independent, hence my problem.
Anyone have an idea?
Codestack Macro:
The end of the code edit:
Sub CopySheet(draw As SldWorks.DrawingDoc, sheet As SldWorks.sheet, SheetName As String)
Dim swNewSheet As SldWorks.sheet
Set swNewSheet = draw.sheet(draw. GetSheetNames()(draw. GetSheetCount() - 1))
Dim vViews As Variant
vViews = swNewSheet.GetViews
Set swDraw = swApp.ActiveDoc
Dim vSheetNames As Variant
vSheetNames = swDraw.GetSheetNames
Dim i As Integer
Sun j As Integer
For j = 0 TB UBound(vSheetNames)
For i = 0 TB UBound(vViews)
Dim swView As SldWorks.View
Set swView = vViews(i)
swView.ReferencedConfiguration = SheetName
Next i
Next j
End Sub