Your Products have been synced, click here to refresh
[SIZE=14px][FONT=times new roman][COLOR=#0000ff][COLOR=#0000ff]Sub[/COLOR][/COLOR] Main() [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] PCDApp,PCDPartProgram, PCDCommands, PCDCommand, retval [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] objFSO [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] objFSO = CreateObject ("Scripting.FileSystemObject") [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDApp = CreateObject("PCDLRN.Application") [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDPartPrograms = PCDApp.PartPrograms [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDPartProgram = PCDApp.ActivePartProgram [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] Cmds [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Object[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] Cmd [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Object[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] Cmds = PCDPartProgram.Commands [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] setCrntName [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]String[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] PartNo [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Object[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] JobNo [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Object[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] SerNo [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Object[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] SerialNo [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]String[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] Results [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]String[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PartNo = PCDPartProgram.GetVariableValue ("V5") [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] JobNo = PCDPartProgram.GetVariableValue ("V1") [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] SerNo = PCDPartProgram.GetVariableValue ("V2") [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] Serial = PCDPartProgram.GetVariableValue ("V2") strPath = "Q:\Quality\In Process Inspection Plans\PartNo.StringValue\CMM REPORTS\" strFolderName = JobNo.StringValue & "_" & SerNo.StringValue strFolder = strPath & "\RESULTS\" & strFolderName [COLOR=#0000ff][COLOR=#0000ff]If[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Not[/COLOR][/COLOR] objFSO.FolderExists(strFolder) [COLOR=#0000ff][COLOR=#0000ff]Then[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] objFolder = objFSO.CreateFolder(strFolder) [COLOR=#0000ff][COLOR=#0000ff]End[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]If[/COLOR][/COLOR] SerialNo = Serial.StringValue setCrntName = PCDPartProgram.FullName newname = "Q:\Quality\In Process Inspection Plans\" & PartNo.StringValue & "\CMM REPORTS\ObjFolder\" & PCDPartProgram.PartName & " - " & SerialNo & ".PRG" retval = PCDPartProgram.SaveAs(newname) retval = PCDPartProgram.SaveAs(setCrntName) [COLOR=#007f00][COLOR=#007f00]' Cleanup [/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDPartProgram = [COLOR=#0000ff][COLOR=#0000ff]Nothing[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDPartPrograms = [COLOR=#0000ff][COLOR=#0000ff]Nothing[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDApp = [COLOR=#0000ff][COLOR=#0000ff]Nothing[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]End[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Sub[/COLOR][/COLOR][/FONT][/SIZE]
[SIZE=14px][FONT=times new roman][COLOR=#0000ff][COLOR=#0000ff]Sub[/COLOR][/COLOR] Main() [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] PCDApp,PCDPartProgram, PCDCommands, PCDCommand, retval [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] objFSO [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] objFSO = CreateObject ("Scripting.FileSystemObject") [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDApp = CreateObject("PCDLRN.Application") [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDPartPrograms = PCDApp.PartPrograms [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDPartProgram = PCDApp.ActivePartProgram [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] Cmds [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Object[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] Cmd [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Object[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] Cmds = PCDPartProgram.Commands [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] setCrntName [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]String[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] PartNo [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Object[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] JobNo [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Object[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] SerNo [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Object[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] SerialNo [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]String[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Dim[/COLOR][/COLOR] Results [COLOR=#0000ff][COLOR=#0000ff]As[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]String[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PartNo = PCDPartProgram.GetVariableValue ("V5") [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] JobNo = PCDPartProgram.GetVariableValue ("V1") [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] SerNo = PCDPartProgram.GetVariableValue ("V2") [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] Serial = PCDPartProgram.GetVariableValue ("V2") strPath = "Q:\Quality\In Process Inspection Plans\PartNo.StringValue\CMM REPORTS\" strFolderName = JobNo.StringValue & "_" & SerNo.StringValue strFolder = strPath & "\RESULTS\" & strFolderName [COLOR=#0000ff][COLOR=#0000ff]If[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Not[/COLOR][/COLOR] objFSO.FolderExists(strFolder) [COLOR=#0000ff][COLOR=#0000ff]Then[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] objFolder = objFSO.CreateFolder(strFolder) [COLOR=#0000ff][COLOR=#0000ff]End[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]If[/COLOR][/COLOR] SerialNo = Serial.StringValue setCrntName = PCDPartProgram.FullName newname = "Q:\Quality\In Process Inspection Plans\" & PartNo.StringValue & "\CMM REPORTS\ObjFolder\" & PCDPartProgram.PartName & " - " & SerialNo & ".PRG" retval = PCDPartProgram.SaveAs(newname) retval = PCDPartProgram.SaveAs(setCrntName) [COLOR=#007f00][COLOR=#007f00]' Cleanup [/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDPartProgram = [COLOR=#0000ff][COLOR=#0000ff]Nothing[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDPartPrograms = [COLOR=#0000ff][COLOR=#0000ff]Nothing[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Set[/COLOR][/COLOR] PCDApp = [COLOR=#0000ff][COLOR=#0000ff]Nothing[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]End[/COLOR][/COLOR] [COLOR=#0000ff][COLOR=#0000ff]Sub[/COLOR][/COLOR][/FONT][/SIZE]
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |