JamesMcD
Automotive
- Dec 10, 2001
- 25
I have a macro which I pieced together from another one found on the web. It saves a drawing as a pdf and names the file with a concatenated list of properties. My problem is that the properties I want it to look at are in the part file, not the drawing, and I don't know how to get the macro to look in the part as opposed to the current/active document (the drawing) which it is printing.
------------------------
Here is part of the code:
Set swCustPrpMgr = swModel.Extension.CustomPropertyManager("")
'Get Custom Property
swCustPrpMgr.Get3 "Part Number", False, "", vPartNumber
swCustPrpMgr.Get3 "Description", False, "", vDescription
swCustPrpMgr.Get3 "Revision", False, "", vRevision
swCustPrpMgr.Get3 "Date", False, "", vDate
filename = vPartNumber & "_" & vDescription & "_" & vRevision & "_" & vDate & ".PDF"
boolstatus = swExportData.SetSheets(swExportData_ExportAllSheets, 1)
boolstatus = swModelDocExt.SaveAs(filename, 0, 0, swExportData, lErrors, lWarnings)
-----------------------------------------
Thanks for any help,
James
------------------------
Here is part of the code:
Set swCustPrpMgr = swModel.Extension.CustomPropertyManager("")
'Get Custom Property
swCustPrpMgr.Get3 "Part Number", False, "", vPartNumber
swCustPrpMgr.Get3 "Description", False, "", vDescription
swCustPrpMgr.Get3 "Revision", False, "", vRevision
swCustPrpMgr.Get3 "Date", False, "", vDate
filename = vPartNumber & "_" & vDescription & "_" & vRevision & "_" & vDate & ".PDF"
boolstatus = swExportData.SetSheets(swExportData_ExportAllSheets, 1)
boolstatus = swModelDocExt.SaveAs(filename, 0, 0, swExportData, lErrors, lWarnings)
-----------------------------------------
Thanks for any help,
James