Hello
I would like to modify the macro below to use a property of the part as the DXF filename. (instead of adding the hint)
Can you help me, I don't know how to program macros and I have 500 files to process
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
If Part.GetType = swDocDRAWING Then 'verif type document
Set swModExt = Part.Extension
Set Prop = swModExt.CustomPropertyManager("")
Part.ForceRebuild3 True
Set swView = Part.GetFirstView
'the first view being the sheet, move on to the next
Set swView = swView.GetNextView
Coin recovery
Set swModel = swView.ReferencedDocument
Set swModExt = swModel.Extension
Assignment from "Index" to "Att"
Dim RevTable as Object
Set Prop = swModExt.CustomPropertyManager("")
Set RevTable = Part.GetCurrentSheet.RevisionTable
Set custpropmgr = Part.Extension.CustomPropertyManager("")
Att = "" 'initializes the Ind variable
Att = RevTable.Text(0, 0)
'Att = Part.GetCustomInfoValue("", "Revision") 'retrieves the plan's index
'boolstatus = Prop.Get3("Index", false, ValOut, Att)
If Att = " " Then Att = ""
If Att = "Hint" Then Att = ""
Full Path Recovery
swPathName = Part.GetPathName
If swPathName = "" Then
swApp.SendMsgToUser ("The drawing file is not saved, please do it and start over")
Exit Sub
End If
pathname = Mid(swPathName, 1, Len(swPathName) - 7)
DXF Registration
swPathName = pathname & Att + ".dxf" ' adds _ind and.dxf"
Set swModExt = Part.Extension
Part.ViewZoomtofit2
boolstatus = swModExt.SaveAs(swPathName, 0, 0, swExportPDFData, Errors, Warnings) 'save to dxf
PDF Registration
swPathName = pathname & Att + ".pdf" ' adds _ind and .pdf"
Set swModExt = Part.Extension
Part.ViewZoomtofit2
boolstatus = swModExt.SaveAs(swPathName, 0, 0, swExportPDFData, Errors, Warnings)
Else: swApp.SendMsgToUser ("This macro only works with a drawing")
End If
End Sub