Good afternoon everyone. I have a macro that saves a drawing as a PDF with the current drawing revision attached to the end of the file name. I want to modify the macro to include drawing side, this is where I am stuck at. How do I call out the Solidworks sheet format size property (SW-Sheet Format Size)?
The way I have the code setup is to pull the drawing size (SW-Sheet Format Size) from the custom property, but the custom property for that is not filled out in our drawing files. So I am looking for a way to pull it striaght from the drawing file, or possibly get the code to fill out the custom property for it automatically and then pull it for the macro.
Below is the code I have so far. Any and all help is appreciated.
Dim swApp, Model As Object
Dim ModName, NewName, Siz, Rev, fName As String
Sub main()
Set swApp = CreateObject("SldWorks.Application")
ModName = Model.GetTitle
ModName = Left(ModName, InStr(1, ModName, " ") - 1)
Rev = Model.CustomInfo("REVISION")
Siz = Model.CustomInfo("SW-Sheet Format Size")
fName = ModName + Rev + Siz
pdf = "C:\\" + fName + ".PDF"
Model.SaveAs2 pdf, 0, True, False
End Sub
Thanks,
Marc D
SolidworksApi macros