Hi,
I need some help altering a MACRO.
I have almost zero experience in making macros.
I found this:
Sub main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDrawModel As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim nErrors As Long
Dim nWarnings As Long
Dim Revision As String
Set swApp = Application.SldWorks
Set swDrawModel = swApp.ActiveDoc
If swDrawModel Is Nothing Then
MsgBox "There is no active drawing document"
Exit Sub
End If
If swDrawModel.GetType <> swDocDRAWING Then
MsgBox "Open a drawing first and then TRY again!"
Exit Sub
End If
Set swDraw = swDrawModel
Set swView = swDraw.GetFirstView
Set swView = swView.GetNextView
Set swModel = swView.ReferencedDocument
If swModel.GetPathName = "" Then
MsgBox "Insert a View first and then TRY again!"
Exit Sub
End If
Revision = swModel.GetCustomInfoValue("", "Revision")
If Revision = "" Then
Revision = ""
End If
Prop = ("Rev_")
If Revision = "" Then
Prop = ""
End If
swDraw.SaveAs3 Left(swDraw.GetPathName, InStrRev(swDraw.GetPathName, ".") - 1) & Prop & Revision & ".PDF", 0, 0
End SubAs I understand it, swDraw.SaveAs3 Left(swDraw.GetPathName, InStrRev(swDraw.GetPathName, ".") - 1) & Prop & Revision & ".PDF", 0, 0 is the command to find and alter the file with the revision at the end of the filename, but I cannot find the code that tells where to save the PDF.
Can anyone help me out?
Thanks.
