Your Products have been synced, click here to refresh
Sub Main Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand Dim tX, tY, tZ, tRound, mX, mY, mZ, tD, mD, mRound As String Set PCDApp = CreateObject("PCDLRN.Application") Set PCDPartPrograms = PCDApp.PartPrograms Set PCDPartProgram = PCDApp.ActivePartProgram Set PCDCommands = PCDPartProgram.Commands Dim iCnt As Integer Dim savePath Dim repFolder Dim repName repName = format(now(),"YYYYMMDDHHNNSS") savePath = "D:\PC-DMIS Data\Scripts\TEMP\" repFolder = left(PCDPartProgram.Name,len(PCDPartProgram.Name)-4) Open savePath & repFolder & repName & ".TXT" For Append As #1 For iCnt = 1 To PCDCommands.Count Set PCDCommand = PCDCommands.Item(iCnt) If Left(PCDCommand.ID, 3) = "CIR" Then tX = PCDCommand.GetText(THEO_X, 0) tY = PCDCommand.GetText(THEO_Y, 0) tZ = PCDCommand.GetText(THEO_Z, 0) tD = PCDCommand.GetText(THEO_DIAM, 0) tRound = 0 mX = PCDCommand.GetText(MEAS_X, 0) mY = PCDCommand.GetText(MEAS_Y, 0) mZ = PCDCommand.GetText(MEAS_Z, 0) mD = PCDCommand.GetText(MEAS_DIAM, 0) mRound = max(SQRT(DOT(CIR1.HIT[1..CIR1.NUMHITS].XYZ-CIR1.XYZ,CIR1.HIT[1..CIR1.NUMHITS].XYZ-CIR1.XYZ))) - MIN(SQRT(DOT(CIR1.HIT[1..CIR1.NUMHITS].XYZ-CIR1.XYZ,CIR1.HIT[1..CIR1.NUMHITS].XYZ-CIR1.XYZ))) Write #1, PCDCommand.ID & ", " & tX & ", " & tY & ", " & tZ & ", " & tD & ", " & tRound & ", " & mX & ", " & mY & ", " & mZ & ", " & mD & ", " & mRound End If Next iCnt Close #1 Set PCDCommands = Nothing Set PCDPartProgram = Nothing Set PCDPartPrograms = Nothing Set PCDApp = Nothing End Sub
Sub Main Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand Dim tX, tY, tZ, tRound, mX, mY, mZ, tD, mD, mRound As String Set PCDApp = CreateObject("PCDLRN.Application") Set PCDPartPrograms = PCDApp.PartPrograms Set PCDPartProgram = PCDApp.ActivePartProgram Set PCDCommands = PCDPartProgram.Commands Dim iCnt As Integer Dim savePath Dim repFolder Dim repName repName = format(now(),"YYYYMMDDHHNNSS") savePath = "D:\PC-DMIS Data\Scripts\TEMP\" repFolder = left(PCDPartProgram.Name,len(PCDPartProgram.Name)-4) Open savePath & repFolder & repName & ".TXT" For Append As #1 For iCnt = 1 To PCDCommands.Count Set PCDCommand = PCDCommands.Item(iCnt) If Left(PCDCommand.ID, 3) = "CIR" Then tX = PCDCommand.GetText(THEO_X, 0) tY = PCDCommand.GetText(THEO_Y, 0) tZ = PCDCommand.GetText(THEO_Z, 0) tD = PCDCommand.GetText(THEO_DIAM, 0) tRound = 0 mX = PCDCommand.GetText(MEAS_X, 0) mY = PCDCommand.GetText(MEAS_Y, 0) mZ = PCDCommand.GetText(MEAS_Z, 0) mD = PCDCommand.GetText(MEAS_DIAM, 0) mRound = max(SQRT(DOT(CIR1.HIT[1..CIR1.NUMHITS].XYZ-CIR1.XYZ,CIR1.HIT[1..CIR1.NUMHITS].XYZ-CIR1.XYZ))) - MIN(SQRT(DOT(CIR1.HIT[1..CIR1.NUMHITS].XYZ-CIR1.XYZ,CIR1.HIT[1..CIR1.NUMHITS].XYZ-CIR1.XYZ))) Write #1, PCDCommand.ID & ", " & tX & ", " & tY & ", " & tZ & ", " & tD & ", " & tRound & ", " & mX & ", " & mY & ", " & mZ & ", " & mD & ", " & mRound End If Next iCnt Close #1 Set PCDCommands = Nothing Set PCDPartProgram = Nothing Set PCDPartPrograms = Nothing Set PCDApp = Nothing End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |