AnsweredAssumed Answered

Save as config name in specific folder

Question asked by Andrew Raison on Apr 25, 2019
Latest reply on Apr 25, 2019 by Andrew Raison

Hi guys. I'm working with my marketing director on making a poster for most of our standard parts by family. I have the part files made (design table driven), but the editor needs each individual profile as a Illustrator file at 1:1 scale.

 

I got this far in the code and hit a road bump:

 

Sub main()

 

 

Set swApp = Application.SldWorks

 

 

Set Part = swApp.ActiveDoc

 

 

' Zoom To Fit

Part.ViewZoomtofit2

 

 

' Zoom To Fit

Part.ViewZoomtofit2

 

 

' Zoom To Fit

Part.ViewZoomtofit2

 

 

' Save As

longstatus = Part.SaveAs3("P:\ENGINEERING\Andrew\~Poster project\SC\AI Files\SC020-0500.ai", 0, 2)

boolstatus = Part.ActivateView("Drawing View1")

boolstatus = Part.Extension.SelectByID2("Drawing View1", "DRAWINGVIEW", 3.26441150747986E-02, 3.62664649021864E-02, 0, False, 0, Nothing, 0)

boolstatus = Part.ChangeRefConfigurationOfFlatPatternView("C:\vaultviews\cfs-production-vault\design\catalogue parts\SC.SLDPRT", "SC035-0500")

 

 

' Zoom To Fit

Part.ViewZoomtofit2

 

 

' Zoom To Fit

Part.ViewZoomtofit2

 

 

' Zoom To Fit

Part.ViewZoomtofit2

 

 

' Save As

longstatus = Part.SaveAs3("P:\ENGINEERING\Andrew\~Poster project\SC\AI Files\SC035-0500.ai", 0, 2)

End Sub

 

 

I see the line that it switches to the next config, but I want it to switch to the next one in the list, and save the file as "CONFIGNAME".ai then repeat that till the end of the list. I'm not sure what to change to make that happen.

 

Also, I have more files to do this too. Do I have to create a macro for each file?

 

This is my first VBA/Macro project so I'm a little confused.

 

Thanks!

Outcomes