Your Products have been synced, click here to refresh
Sub Main(Cmd_ID As String, Rtrn_ID As String) Dim xl As Object Dim xlBook As Object Dim sPath As String sPath = "C:\BLADERUNNER\Scripts\" Set xl = CreateObject("Excel.application") Set xlBook = xl.Workbooks.Open(sPath & "Scan_Utilities.xlsm", 0, True) xl.Application.Visible = False xl.run "Module1.CheckFunct", Cmd_ID, Rtrn_ID xl.Quit Set xlBook = Nothing Set xl = Nothing End Sub
Function WriteScanFromArray(ByRef Cmd As Object, ByRef ScanArry As Variant) As Boolean Dim i As Integer Dim Retval As Boolean WriteScanFromArray = False 'Verify that target command is a basic scan If Not AttachBasicScan(Cmd) Then Exit Function End If 'Check that Array is allocated and 2D If IsArrayAllocated(ScanArry) Then If NumberOfArrayDimensions(ScanArry) <> 2 Then MsgBox "Array is not 2D!", 0, "Error!" Exit Function End If Else MsgBox "Array not allocated!", 0, "Error!" Exit Function End If 'Check Upper and Lower bounds of Array If UBound(ScanArry, 2) <> 9 Then MsgBox "Array must have 10 values per record!", 0, "Error!" Exit Function End If If LBound(ScanArry, 2) <> 0 Then MsgBox "Array must use 0 for lower boundry!", 0, "Error!" Exit Function End If 'Write array into PC-DMIS feature. For i = LBound(ScanArry, 1) To UBound(ScanArry, 1) Retval = Cmd.PutText(CStr(UBound(ScanArry, 1) + 1), N_HITS, 0) Retval = Cmd.PutText(CStr(ScanArry(i, 0)), THEO_X, i + 1) Retval = Cmd.PutText(CStr(ScanArry(i, 1)), THEO_Y, i + 1) Retval = Cmd.PutText(CStr(ScanArry(i, 2)), THEO_Z, i + 1) Retval = Cmd.PutText(CStr(ScanArry(i, 3)), THEO_I, i + 1) Retval = Cmd.PutText(CStr(ScanArry(i, 4)), THEO_J, i + 1) Retval = Cmd.PutText(CStr(ScanArry(i, 5)), THEO_K, i + 1) Retval = Cmd.PutText(CStr(ScanArry(i, 6)), MEAS_X, i + 1) Retval = Cmd.PutText(CStr(ScanArry(i, 7)), MEAS_Y, i + 1) Retval = Cmd.PutText(CStr(ScanArry(i, 8)), MEAS_Z, i + 1) Retval = Cmd.PutText(CStr(ScanArry(i, 9)), T_VALUE, i + 1) Next i WriteScanFromArray = True End Function
Function WriteScanFromArray(ByRef Cmd As [COLOR="#FF0000"]PCDLRN.Command[/COLOR], ByRef ScanArry As Variant) As Boolean
dim oFeatCmd as PCDLRN.FeatCmd Set oFeatCmd = Cmd.FeatureCommand With Cmd.oFeatCmd For i = LBound(ScanArry, 1) To UBound(ScanArry, 1) .SetHit(i, FHITDATA_CENTROID, FDATA_THEO, CStr(ScanArry(i, 0)), CStr(ScanArry(i, 1)), CStr(ScanArry(i, 2))) .SetHit(i, FHITDATA_VECTOR, FDATA_THEO, CStr(ScanArry(i, 3)), CStr(ScanArry(i, 4)), CStr(ScanArry(i, 5))) .SetHit(i, FHITDATA_CENTROID, FDATA_MEAS, CStr(ScanArry(i, 6)), CStr(ScanArry(i, 7)), CStr(ScanArry(i, 8))) Retval = Cmd.PutText(CStr(ScanArry(i, 9)), T_VALUE, i + 1) Next i End With
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |