Extract High & Low Deviation from Cloud-to-CAD Report

VB Script - Extract High & Low Deviation from Cloud-to-CAD Report

When reporting Cloud-to-CAD it is possible to display the Min / Max / RMS / Profile / etc. however only the individual Point X, Y, Z, or 3D value(s) can be set to Variable using the GetReportInfo() VB command like this:

  1. MyVar = GetReportInfo( "Cloud-to-CAD Deviation", "CLOUD1:P1:3D" , 3 )

However using VB, it is possible to count the points in the Cloud and then set each individual 3D deviation to a variable and finally identify the high and low points.

Considering the following report item:


You could use this VB Script to set variables containing Min and Max deviation:

  1. NumPts = GetFeaturePropertyAct("CLOUD1", 1 )

  2. MxDev = 0
  3. MnDev = 0

  4. for i = 1 to NumPts

  5.   PtNm = "CLOUD1:P" + CStr(i) + ":3D"
  6.   Dev = GetReportInfo( "Cloud-to-CAD Deviation", PtNm, 3 )

  7.   If Dev > MxDev Then
  8.     MxDev = Dev
  9.   End If

  10.   If Dev < MnDev Then
  11.     MnDev = Dev
  12.   End If
  13. next

  14. MxDev = Round(MxDev, 4)
  15. MnDev = Round(MnDev, 4)

  16. MsgBox("Max deviation is: " + CStr(MxDev) + Chr(10) + "Min deviation is: " + CStr(MnDev))

Upon running program the High and Low (Max / Min) point are displayed in MsgBox()



See attached program for reference.  Note - this program can be run on any CMM as it contains no measured features.