The serial is added to the partprogram filename:
Let's say that the partprogram name is 'Heatshield_1' and when entering the serial as 'number 1' the partprogram is saved as 'Heatshield_1_number 1.prg'.
REMOVED
Your Products have been synced, click here to refresh
REMOVED
Sub Main ' This Script will Append the serial number entered In the C1 Input comment In the PC-DMIS program ' To the part program Name And save the file into a folder named "RESULTS" that resides ' In the same directory As the part program. It will Then resave As the original part program Name In ' the original directory, ready To be executed again. '--------------------------------------------------------------- ' Create a Folder In the same directory As the Part Program called "RESULTS" ' Insert this code at beginning of PC-DMIS program: ' C1 =COMMENT/Input, NO, FULL SCREEN=NO, ' Enter Part Serial Number ' ASSIGN/SER_NUM=(C1.Input) '------------------------------------------------------------- Dim App As Object Dim Part As Object Dim Serial As Object Dim strCrntName As String Dim strPath As String Dim strPrgName As String Dim strNewName As String Dim strNoExt As String Dim bolPassFail As Boolean Dim FindDot Set App = CreateObject ("PCDLRN.Application") Set Part = App.ActivePartProgram Set Serial = Part.GetVariableValue ("SER_NUM") strCrntName = Part.FullName strPath = Part.Path strPrgName = Part.Name FindDot = InStr(1, strPrgName, ".") strNoExt = Left(strPrgName, FindDot - 1) strNewName = strPath & "RESULTS\" & strNoExt & "_" & Serial.StringValue & ".prg" bolPassFail = Part.SaveAs (strNewName) bolPassFail = Part.SaveAs (strCrntName) End Sub
Sub Main ' This Script will Append the serial number entered In the C1 Input comment In the PC-DMIS program ' To the part program Name And save the file into a folder named "RESULTS" that resides ' In the same directory As the part program. It will Then resave As the original part program Name In ' the original directory, ready To be executed again. '--------------------------------------------------------------- ' Create a Folder In the same directory As the Part Program called "RESULTS" ' Insert this code at beginning of PC-DMIS program: ' C1 =COMMENT/Input, NO, FULL SCREEN=NO, ' Enter Part Serial Number ' ASSIGN/SER_NUM=(C1.Input) '------------------------------------------------------------- Dim App As Object Dim Part As Object Dim Serial As Object Dim strCrntName As String Dim strPath As String Dim strPrgName As String Dim strNewName As String Dim strNoExt As String Dim bolPassFail As Boolean Dim FindDot Set App = CreateObject ("PCDLRN.Application") Set Part = App.ActivePartProgram Set Serial = Part.GetVariableValue ("SER_NUM") strCrntName = Part.FullName strPath = Part.Path strPrgName = Part.Name FindDot = InStr(1, strPrgName, ".") strNoExt = Left(strPrgName, FindDot - 1) strNewName = strPath & "RESULTS\" & strNoExt & "_" & Serial.StringValue & ".prg" bolPassFail = Part.SaveAs (strNewName) bolPassFail = Part.SaveAs (strCrntName) End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |