here is the script, if any one could double check this. original script was pulled from a post here, I think by vpt.se
'Script for saving PC-DMIS reports by serial number in Work Order folder 'Will create folder for work order if none is present 'SETTINGS FOR USE 'Program should have 2 comments and ASSIGN variables created for the inputs of those comments as shown below 'C1 =COMMENT/INPUT,YES,FULL SCREEN=NO, ' WORK ORDER 'C2 =COMMENT/INPUT,YES,FULL SCREEN=NO, ' SERIAL NUMBER ' ASSIGN/WO=C1.INPUT ' ASSIGN/SN=C2.INPUT 'At the end of program create another ASSIGN variable labeled REPORT_PATH and its value should be the file location you want reports in, minus the work order folder 'and with the "+WO+" variable at the end 'Example of assignment - ASSIGN/REPORT_PATH="F:\QUALITY\CMM\CMM inspection reports\BOEING\314A6128-21\\"+WO+" 'After this line enable the script to run in the program, and mark script code lines 'Now ASSIGN variable labled VAR_FILENAME and its value should have the same path as above but with the addition of SN variable and .PDF to enable the report to save 'Example of this assignment - ASSIGN/VAR_FILENAME="F:\QUALITY\CMM\CMM inspection reports\BOEING\314A6128-21\\"+WO+"\\"+SN+".PDF" 'After this, in the edit window, hit ENTER then type "PRINT" then hit TAB, and place cursor in the new code and hit F9, click the report output checkbox 'And in the text box below type VAR_FILENAME 'Then click the "Overwrite" option, "PDF" option, and select any other options you see fit 'Auto archive of reports is now set up and ready to run 'Notes for use written by ANDY SMITH, script pulled from PC-DMIS Forum, and edited for use by ANDY SMITH, original script by DaVe_M Sub Main() Dim objFSO, objShell Dim PCDApp, PCDPartProgram, PCDCommands, PCDCommand, retval Dim objFile, objFolder As Object Set PCDApp=CreateObject("PCDLRN.Application") Set PCDPartProgram=PCDApp.ActivePartProgram Set PCDCommands=PCDPartProgram.Commands Set Pathname=PCDPartProgram.GetVariableValue("REPORT_PATH") strPath=Pathname.StringValue Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strPath) Then 'Nothing Else Set objFile=objFSO.CreateFolder(strPath) End If End Sub
Attached Files