Your Products have been synced, click here to refresh
Sub Main_230709() ' Dim something --------------------------- Dim App As Object Set App = CreateObject("PCDLRN.Application") Dim Part As Object Set Part = App.ActivePartProgram Dim Cmds As Object Set Cmds = Part.Commands Dim Cmd As Object Set Cmd = Nothing Dim sPath As String Dim iPoints As Integer Dim mx(), my(), mz() As Double ' File sPath = "C:\Test.txt" Open sPath For Output As #1 ' search For Each Cmd In Cmds If Cmd.Type = BASIC_SCAN_OBJECT Then iPoints = Cmd.GetText(N_HITS, 0) ReDim mx(iPoints) ReDim my(iPoints) ReDim mz(iPoints) For iCount = 1 To iPoints mx(iCount) = Cmd.GetText(MEAS_X, iCount) my(iCount) = Cmd.GetText(MEAS_Y, iCount) mz(iCount) = Cmd.GetText(MEAS_Z, iCount) 'Print #1, "MOVE/POINT,NORMAL,<", xm, ",", ym, ",", zm, ">" Next iCount End If Next Cmd Close #1 ' add retVal = Cmds.InsertionPointAfter(Cmds.LastCommand) For iCount = 1 To iPoints Set Cmd = Cmds.Add(MOVE_POINT, True) Cmd.Marked = True retVal = Cmd.SetToggleString(1, NORM_RELEARN, 0) retVal = Cmd.PutText(CStr(mx(iCount)), THEO_X, 0) retVal = Cmd.PutText(CStr(my(iCount)), THEO_Y, 0) retVal = Cmd.PutText(CStr(mz(iCount)), THEO_Z, 0) Next iCount Part.RefreshPart End Sub
Sub Main_230709() ' Dim something --------------------------- Dim App As Object Set App = CreateObject("PCDLRN.Application") Dim Part As Object Set Part = App.ActivePartProgram Dim Cmds As Object Set Cmds = Part.Commands Dim Cmd As Object Set Cmd = Nothing Dim sPath As String Dim iPoints As Integer Dim mx(), my(), mz() As Double ' File sPath = "C:\Test.txt" Open sPath For Output As #1 ' search For Each Cmd In Cmds If Cmd.Type = BASIC_SCAN_OBJECT Then iPoints = Cmd.GetText(N_HITS, 0) ReDim mx(iPoints) ReDim my(iPoints) ReDim mz(iPoints) For iCount = 1 To iPoints mx(iCount) = Cmd.GetText(MEAS_X, iCount) my(iCount) = Cmd.GetText(MEAS_Y, iCount) mz(iCount) = Cmd.GetText(MEAS_Z, iCount) 'Print #1, "MOVE/POINT,NORMAL,<", xm, ",", ym, ",", zm, ">" Next iCount End If Next Cmd Close #1 ' add retVal = Cmds.InsertionPointAfter(Cmds.LastCommand) For iCount = 1 To iPoints Set Cmd = Cmds.Add(MOVE_POINT, True) Cmd.Marked = True retVal = Cmd.SetToggleString(1, NORM_RELEARN, 0) retVal = Cmd.PutText(CStr(mx(iCount)), THEO_X, 0) retVal = Cmd.PutText(CStr(my(iCount)), THEO_Y, 0) retVal = Cmd.PutText(CStr(mz(iCount)), THEO_Z, 0) Next iCount Part.RefreshPart End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |