hexagon logo

Extract sample points

Is it possible to extract the sample points taken on a diameter (Auto CIR or Auto CYL)? I have to measure the surfaces around some holes on an assembly and the hole locations and would just add more sample points than the standard (3) instead of measuring the diameter and measure a plane.
  • I have been trying to do that some versions back using the assignment builder, without any luck. YMMV though.
  • Why not measure the plane first, and use that plane as 'sample feature' for the CIR/CYL instead of sample points?
  • We are required by company policy to take a minimum of three sample hits on all circles and cylinders and I'm just trying to reduce the number of features in the program.
  • Why not measure the plane first, and use that plane as 'sample feature' for the CIR/CYL instead of sample points?

    I think this (^^^) would be the easiest in the long run. However, if you had to extract the sample hits something like this could work...

    CYL6       =FEAT/CONTACT/CYLINDER/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<0,0,0>,<0,0,1>,0.5,0.375
                ACTL/<0,0,0>,<0,0,1>,0.5,0.375
                TARG/<0,0,0>,<0,0,1>
                START ANG=0,END ANG=360
                ANGLE VEC=<1,0,0>
                DIRECTION=CCW
                REPORT VEC=<0.2706061,0.653305,0.707082>
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=YES
                  NUMHITS=6,NUMLEVELS=2,DEPTH=0.2,END OFFSET=1,PITCH=0
                  SAMPLE METHOD=SAMPLE_HITS
                  SAMPLE HITS=3,SPACER=0.25
                  AVOIDANCE MOVE=BOTH,DISTANCE=0.375
                  FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                SHOW HITS=NO
                ASSIGN/V1=GETTEXT("SAMPLE_HIT_THEO_X",1,{CYL6})
                ASSIGN/V2=GETTEXT("SAMPLE_HIT_THEO_Y",1,{CYL6})
                ASSIGN/V3=GETTEXT("SAMPLE_HIT_THEO_Z",1,{CYL6})
                ASSIGN/V4=GETTEXT("SAMPLE_HIT_THEO_I",1,{CYL6})
                ASSIGN/V5=GETTEXT("SAMPLE_HIT_THEO_J",1,{CYL6})
                ASSIGN/V6=GETTEXT("SAMPLE_HIT_THEO_K",1,{CYL6})
                ASSIGN/V7=GETTEXT("SAMPLE_HIT_MEAS_X",1,{CYL6})
                ASSIGN/V8=GETTEXT("SAMPLE_HIT_MEAS_Y",1,{CYL6})
                ASSIGN/V9=GETTEXT("SAMPLE_HIT_MEAS_Z",1,{CYL6})
    F1         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                NOM/XYZ,<V1,V2,V3>,$
                MEAS/XYZ,<V7,V8,V9>,$
                NOM/IJK,<V4,V5,V6>,$
                MEAS/IJK,<V4,V5,V6>
    DIM LOC1= LOCATION OF POINT F1  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
    X       0.5000     0.0020    -0.0020     0.5000     0.0000     0.0000 ----#----
    Y       0.0000     0.0020    -0.0020     0.0000     0.0000     0.0000 ----#----
    Z       0.0000     0.0020    -0.0020     0.0000     0.0000     0.0000 ----#----
    END OF DIMENSION LOC1

    This only gets the first sample hit. You would need to repeat as needed for whatever number of sample hits you have. Just increment the index number ( "1" in this case and immediately before the feature label reference). Seems like a lot of work though.
  • Does anyone know for sure how "sample hits" are probe compensated - nominal direction or in the direction of the created 'plane'? Will extracting those points be equivalent to actually measuring a plane at exactly the same coordinates?

    Maybe there's a reason for the 'unavailability' of the sample hits?
  • Here is the Features to Points edited to create Vector and Generic Points from Auto Circle and Cylinder Sample Hits.

    '===========================================================================
    ' To Points
    '
    ' Extracts hits from features And creates vectorpoints With
    ' the hits THEO's.
    '
    ' The names are created from the source feature Name And a number that
    ' represents the hit index.
    '
    ' Idea taken from 'to_points.exe' from the Wilcox Script Repository
    ' which sadly doesn't work As expected.
    '
    ' (c) vpt.se 2010-06-15
    ' Updated davehocum 20150311
    ' 20150406 Added To Vector Sample Points, To Generic Sample Points, To Read Point And AndersI Live Gen. Points.
    ' Added Palor Check Box. Polar will remove the .HIT[ ] from the NOM And MEAS For the Live Gen. Points. 
    ' Not all Auto Feature will work With the To Vector Sample Points And To Generic Sample Points.
    '===========================================================================
    Sub Main()
    Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand
    Dim PCDFeatCmd
    Dim prbhit
    Dim numhits As Integer
    Set PCDApp = CreateObject("PCDLRN.Application")
    Set PCDPartPrograms = PCDApp.PartPrograms
    Set PCDPartProgram = PCDApp.ActivePartProgram
    Set PCDCommands = PCDPartProgram.Commands
    Dim cmd As Object
    Dim Fcntr As Integer
    Dim FeatureList$(9999)
    Dim hX As Double, hY As Double, hZ As Double, hI As Double, hJ As Double, hK As Double
    Dim tX, tY, tZ, mX, mY, mZ As String
     
    '***** Predialog START
    Fcntr = 0
    ' Enumerate commands
    For Each cmd In PCDCommands
    '----- Measured (learned) feature
     'If cmd.IsMeasuredFeature Then 
        'FeatureList(Fcntr) = cmd.ID
        'Fcntr = Fcntr + 1
      'End If
    '----- Autofeature (flagged As DCC feature)
     'If cmd.IsDCCFeature Then
        'FeatureList(Fcntr) = cmd.ID
        'Fcntr = Fcntr + 1
      'End If
    '----- Constructed feature
    'If cmd.IsConstructedFeature Then
        'FeatureList(Fcntr) = cmd.ID
        'Fcntr = Fcntr + 1
      'End If
    '----- All Features
    If cmd.IsFeature Then
        FeatureList(Fcntr) = cmd.ID
        Fcntr = Fcntr + 1
     End If
     
    Next cmd
    '*****
    '***** Dialog START
    Begin Dialog DIALOG_1 31,48, 245, 280, "Feature to Points v2.0"
    ListBox 88,8,150,250, FeatureList$(), .ListBox
      PushButton 8,72,62,12, "To Vector S Pnts", .VsPointsBtn 
      PushButton 8,93,62,12, "To Generic S Pnts", .GsPointsBtn 
      PushButton 8,255,52,12, "Cancel", .CancelBtn
    End Dialog
    Dim Dlg1 As DIALOG_1
    button = Dialog(Dlg1)
    ' button 0 = Cancel, button 1 = To Vector points, button 2 = To Cast Points, button 3 = To Generic Points, 
    ' button 4 = To Vector S Pnts, button 5 = To Generic S Pnts, button 6 = To Read Point, button 7 = Live Gen. Points, button 8 = Random Error, 
    '*****
    '***** Vector Point Generation Sample Hits
    Fcntr = 0
    If button = 1 Then
      Set PCDCommand = PCDCommands.Item(FeatureList(Dlg1.Listbox)) 
      Set PCDFeatCmd = PCDCommand.FeatureCommand
      numhits = PCDFeatCmd.PermHits
      Set prbhit = CreateObject("PCDLRN.PointData")
    For Fcntr = 1 To numhits
      ' Get the probehits - XYZ  
      Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_CENTROID, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP)
      vX = CDbl(prbhit.X)
      vY = CDbl(prbhit.Y)
      vZ = CDbl(prbhit.Z)
      ' Get the probehits - IJK
      Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_VECTOR, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP)
      vI = CDbl(prbhit.X)
      vJ = CDbl(prbhit.Y)
      vK = CDbl(prbhit.Z)
    ' Create Vector points feature "AUTO__VECTOR_HIT" (COMMAND INFORMATION CODE edit screen) 602
    ' Create Cast points feature "CONST__CAST_POINT" (COMMAND INFORMATION CODE edit screen) 517
    ' Create Generic points feature "GENERIC_CONSTUCTION" (COMMAND INFORMATION CODE edit screen) 597
    ' Create Constructed Feature Set "CONST__SET" (COMMAND INFORMATION CODE edit screen) 596 
      Set cmd = PCDCommands.Add(602, True)
      cmd.Marked = True
      'Featurename is "sourcefeaturename-hitnumber" -> PLANE1-1
      retval = cmd.PutText (PCDCommand.ID & "_S" & Fcntr, ID, 0)
      'Result = cmd.SetExpression (PCDCommand.ID & "." & "HIT" & "[" & Fcntr & "]" , REF_ID, 0)
      ' Theo's
      retval = cmd.PutText (vX, THEO_X, 0)
      retval = cmd.PutText (vY, THEO_Y, 0)
      retval = cmd.PutText (vZ, THEO_Z, 0)
      retval = cmd.PutText (vI, THEO_I, 0)
      retval = cmd.PutText (vJ, THEO_J, 0)
      retval = cmd.PutText (vK, THEO_K, 0)
      ' Actl's
      retval = cmd.PutText (vX, MEAS_X, 0)
      retval = cmd.PutText (vY, MEAS_Y, 0)
      retval = cmd.PutText (vZ, MEAS_Z, 0)
      retval = cmd.PutText (vI, MEAS_I, 0)
      retval = cmd.PutText (vJ, MEAS_J, 0)
      retval = cmd.PutText (vK, MEAS_K, 0)
      ' Targ's
      retval = cmd.PutText (vX, TARG_X, 0)
      retval = cmd.PutText (vY, TARG_Y, 0)
      retval = cmd.PutText (vZ, TARG_Z, 0)
      retval = cmd.PutText (vI, TARG_I, 0)
      retval = cmd.PutText (vJ, TARG_J, 0)
      retval = cmd.PutText (vK, TARG_K, 0)
      PCDPartProgram.RefreshPart
      cmd.ReDraw
      
    Next
    MsgBox "Vector Point Generation Sample Hits Complete"
    End If
    '***** Generic Point Generation Sample Hits
    Fcntr = 0
    If button = 2 Then
      Set PCDCommand = PCDCommands.Item(FeatureList(Dlg1.Listbox)) 
      Set PCDFeatCmd = PCDCommand.FeatureCommand
      numhits = PCDFeatCmd.PermHits
      Set prbhit = CreateObject("PCDLRN.PointData")
    For Fcntr = 1 To numhits
      ' Get the probehits - XYZ  
      Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_CENTROID, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP)
      gX = CDbl(prbhit.X)
      gY = CDbl(prbhit.Y)
      gZ = CDbl(prbhit.Z)
      ' Get the probehits - IJK
      Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_VECTOR, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP)
      gI = CDbl(prbhit.X)
      gJ = CDbl(prbhit.Y)
      gK = CDbl(prbhit.Z)
    ' Create Vector points feature "AUTO__VECTOR_HIT" (COMMAND INFORMATION CODE edit screen) 602
    ' Create Cast points feature "CONST__CAST_POINT" (COMMAND INFORMATION CODE edit screen) 517
    ' Create Generic points feature "GENERIC_CONSTUCTION" (COMMAND INFORMATION CODE edit screen) 597
    ' Create Constructed Feature Set "CONST__SET" (COMMAND INFORMATION CODE edit screen) 596 
      Set cmd = PCDCommands.Add(597, True)
      cmd.Marked = True
      'Featurename is "sourcefeaturename-hitnumber" -> PLANE1-1
      retval = cmd.PutText (PCDCommand.ID & "_SG" & Fcntr, ID, 0)
      'Result = cmd.SetExpression (PCDCommand.ID & "." & "HIT" & "[" & Fcntr & "]" , REF_ID, 0)
      ' Theo's
      retval = cmd.PutText (gX, THEO_X, 0)
      retval = cmd.PutText (gY, THEO_Y, 0)
      retval = cmd.PutText (gZ, THEO_Z, 0)
      retval = cmd.PutText (gI, THEO_I, 0)
      retval = cmd.PutText (gJ, THEO_J, 0)
      retval = cmd.PutText (gK, THEO_K, 0)
      ' Actl's
      retval = cmd.PutText (gX, MEAS_X, 0)
      retval = cmd.PutText (gY, MEAS_Y, 0)
      retval = cmd.PutText (gZ, MEAS_Z, 0)
      retval = cmd.PutText (gI, MEAS_I, 0)
      retval = cmd.PutText (gJ, MEAS_J, 0)
      retval = cmd.PutText (gK, MEAS_K, 0)
      ' Targ's
      retval = cmd.PutText (gX, TARG_X, 0)
      retval = cmd.PutText (gY, TARG_Y, 0)
      retval = cmd.PutText (gZ, TARG_Z, 0)
      retval = cmd.PutText (gI, TARG_I, 0)
      retval = cmd.PutText (gJ, TARG_J, 0)
      retval = cmd.PutText (gK, TARG_K, 0)
      PCDPartProgram.RefreshPart
      cmd.ReDraw
      
    Next
    MsgBox "Generic Point Generation Sample Hits Complete"
    End If
    '*****
    '*****
    '***** Cleanup
    Set PCDApp = Nothing
    Set PCDPartPrograms = Nothing
    Set PCDPartProgram = Nothing
    Set PCDCommands = Nothing
    Set prbhit = Nothing
    '*****
    End Sub
    
    
    
    
    
  • Here is the Features to Points edited to create Vector and Generic Points from Auto Circle and Cylinder Sample Hits.

    '===========================================================================
    ' To Points
    '
    ' Extracts hits from features And creates vectorpoints With
    ' the hits THEO's.
    '
    ' The names are created from the source feature Name And a number that
    ' represents the hit index.
    '
    ' Idea taken from 'to_points.exe' from the Wilcox Script Repository
    ' which sadly doesn't work As expected.
    '
    ' (c) vpt.se 2010-06-15
    ' Updated davehocum 20150311
    ' 20150406 Added To Vector Sample Points, To Generic Sample Points, To Read Point And AndersI Live Gen. Points.
    ' Added Palor Check Box. Polar will remove the .HIT[ ] from the NOM And MEAS For the Live Gen. Points. 
    ' Not all Auto Feature will work With the To Vector Sample Points And To Generic Sample Points.
    '===========================================================================
    Sub Main()
    Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand
    Dim PCDFeatCmd
    Dim prbhit
    Dim numhits As Integer
    Set PCDApp = CreateObject("PCDLRN.Application")
    Set PCDPartPrograms = PCDApp.PartPrograms
    Set PCDPartProgram = PCDApp.ActivePartProgram
    Set PCDCommands = PCDPartProgram.Commands
    Dim cmd As Object
    Dim Fcntr As Integer
    Dim FeatureList$(9999)
    Dim hX As Double, hY As Double, hZ As Double, hI As Double, hJ As Double, hK As Double
    Dim tX, tY, tZ, mX, mY, mZ As String
     
    '***** Predialog START
    Fcntr = 0
    ' Enumerate commands
    For Each cmd In PCDCommands
    '----- Measured (learned) feature
     'If cmd.IsMeasuredFeature Then 
        'FeatureList(Fcntr) = cmd.ID
        'Fcntr = Fcntr + 1
      'End If
    '----- Autofeature (flagged As DCC feature)
     'If cmd.IsDCCFeature Then
        'FeatureList(Fcntr) = cmd.ID
        'Fcntr = Fcntr + 1
      'End If
    '----- Constructed feature
    'If cmd.IsConstructedFeature Then
        'FeatureList(Fcntr) = cmd.ID
        'Fcntr = Fcntr + 1
      'End If
    '----- All Features
    If cmd.IsFeature Then
        FeatureList(Fcntr) = cmd.ID
        Fcntr = Fcntr + 1
     End If
     
    Next cmd
    '*****
    '***** Dialog START
    Begin Dialog DIALOG_1 31,48, 245, 280, "Feature to Points v2.0"
    ListBox 88,8,150,250, FeatureList$(), .ListBox
      PushButton 8,72,62,12, "To Vector S Pnts", .VsPointsBtn 
      PushButton 8,93,62,12, "To Generic S Pnts", .GsPointsBtn 
      PushButton 8,255,52,12, "Cancel", .CancelBtn
    End Dialog
    Dim Dlg1 As DIALOG_1
    button = Dialog(Dlg1)
    ' button 0 = Cancel, button 1 = To Vector points, button 2 = To Cast Points, button 3 = To Generic Points, 
    ' button 4 = To Vector S Pnts, button 5 = To Generic S Pnts, button 6 = To Read Point, button 7 = Live Gen. Points, button 8 = Random Error, 
    '*****
    '***** Vector Point Generation Sample Hits
    Fcntr = 0
    If button = 1 Then
      Set PCDCommand = PCDCommands.Item(FeatureList(Dlg1.Listbox)) 
      Set PCDFeatCmd = PCDCommand.FeatureCommand
      numhits = PCDFeatCmd.PermHits
      Set prbhit = CreateObject("PCDLRN.PointData")
    For Fcntr = 1 To numhits
      ' Get the probehits - XYZ  
      Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_CENTROID, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP)
      vX = CDbl(prbhit.X)
      vY = CDbl(prbhit.Y)
      vZ = CDbl(prbhit.Z)
      ' Get the probehits - IJK
      Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_VECTOR, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP)
      vI = CDbl(prbhit.X)
      vJ = CDbl(prbhit.Y)
      vK = CDbl(prbhit.Z)
    ' Create Vector points feature "AUTO__VECTOR_HIT" (COMMAND INFORMATION CODE edit screen) 602
    ' Create Cast points feature "CONST__CAST_POINT" (COMMAND INFORMATION CODE edit screen) 517
    ' Create Generic points feature "GENERIC_CONSTUCTION" (COMMAND INFORMATION CODE edit screen) 597
    ' Create Constructed Feature Set "CONST__SET" (COMMAND INFORMATION CODE edit screen) 596 
      Set cmd = PCDCommands.Add(602, True)
      cmd.Marked = True
      'Featurename is "sourcefeaturename-hitnumber" -> PLANE1-1
      retval = cmd.PutText (PCDCommand.ID & "_S" & Fcntr, ID, 0)
      'Result = cmd.SetExpression (PCDCommand.ID & "." & "HIT" & "[" & Fcntr & "]" , REF_ID, 0)
      ' Theo's
      retval = cmd.PutText (vX, THEO_X, 0)
      retval = cmd.PutText (vY, THEO_Y, 0)
      retval = cmd.PutText (vZ, THEO_Z, 0)
      retval = cmd.PutText (vI, THEO_I, 0)
      retval = cmd.PutText (vJ, THEO_J, 0)
      retval = cmd.PutText (vK, THEO_K, 0)
      ' Actl's
      retval = cmd.PutText (vX, MEAS_X, 0)
      retval = cmd.PutText (vY, MEAS_Y, 0)
      retval = cmd.PutText (vZ, MEAS_Z, 0)
      retval = cmd.PutText (vI, MEAS_I, 0)
      retval = cmd.PutText (vJ, MEAS_J, 0)
      retval = cmd.PutText (vK, MEAS_K, 0)
      ' Targ's
      retval = cmd.PutText (vX, TARG_X, 0)
      retval = cmd.PutText (vY, TARG_Y, 0)
      retval = cmd.PutText (vZ, TARG_Z, 0)
      retval = cmd.PutText (vI, TARG_I, 0)
      retval = cmd.PutText (vJ, TARG_J, 0)
      retval = cmd.PutText (vK, TARG_K, 0)
      PCDPartProgram.RefreshPart
      cmd.ReDraw
      
    Next
    MsgBox "Vector Point Generation Sample Hits Complete"
    End If
    '***** Generic Point Generation Sample Hits
    Fcntr = 0
    If button = 2 Then
      Set PCDCommand = PCDCommands.Item(FeatureList(Dlg1.Listbox)) 
      Set PCDFeatCmd = PCDCommand.FeatureCommand
      numhits = PCDFeatCmd.PermHits
      Set prbhit = CreateObject("PCDLRN.PointData")
    For Fcntr = 1 To numhits
      ' Get the probehits - XYZ  
      Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_CENTROID, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP)
      gX = CDbl(prbhit.X)
      gY = CDbl(prbhit.Y)
      gZ = CDbl(prbhit.Z)
      ' Get the probehits - IJK
      Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_VECTOR, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP)
      gI = CDbl(prbhit.X)
      gJ = CDbl(prbhit.Y)
      gK = CDbl(prbhit.Z)
    ' Create Vector points feature "AUTO__VECTOR_HIT" (COMMAND INFORMATION CODE edit screen) 602
    ' Create Cast points feature "CONST__CAST_POINT" (COMMAND INFORMATION CODE edit screen) 517
    ' Create Generic points feature "GENERIC_CONSTUCTION" (COMMAND INFORMATION CODE edit screen) 597
    ' Create Constructed Feature Set "CONST__SET" (COMMAND INFORMATION CODE edit screen) 596 
      Set cmd = PCDCommands.Add(597, True)
      cmd.Marked = True
      'Featurename is "sourcefeaturename-hitnumber" -> PLANE1-1
      retval = cmd.PutText (PCDCommand.ID & "_SG" & Fcntr, ID, 0)
      'Result = cmd.SetExpression (PCDCommand.ID & "." & "HIT" & "[" & Fcntr & "]" , REF_ID, 0)
      ' Theo's
      retval = cmd.PutText (gX, THEO_X, 0)
      retval = cmd.PutText (gY, THEO_Y, 0)
      retval = cmd.PutText (gZ, THEO_Z, 0)
      retval = cmd.PutText (gI, THEO_I, 0)
      retval = cmd.PutText (gJ, THEO_J, 0)
      retval = cmd.PutText (gK, THEO_K, 0)
      ' Actl's
      retval = cmd.PutText (gX, MEAS_X, 0)
      retval = cmd.PutText (gY, MEAS_Y, 0)
      retval = cmd.PutText (gZ, MEAS_Z, 0)
      retval = cmd.PutText (gI, MEAS_I, 0)
      retval = cmd.PutText (gJ, MEAS_J, 0)
      retval = cmd.PutText (gK, MEAS_K, 0)
      ' Targ's
      retval = cmd.PutText (gX, TARG_X, 0)
      retval = cmd.PutText (gY, TARG_Y, 0)
      retval = cmd.PutText (gZ, TARG_Z, 0)
      retval = cmd.PutText (gI, TARG_I, 0)
      retval = cmd.PutText (gJ, TARG_J, 0)
      retval = cmd.PutText (gK, TARG_K, 0)
      PCDPartProgram.RefreshPart
      cmd.ReDraw
      
    Next
    MsgBox "Generic Point Generation Sample Hits Complete"
    End If
    '*****
    '*****
    '***** Cleanup
    Set PCDApp = Nothing
    Set PCDPartPrograms = Nothing
    Set PCDPartProgram = Nothing
    Set PCDCommands = Nothing
    Set prbhit = Nothing
    '*****
    End Sub
    
    
    
    
    


    Copy, open Notepad, paste, Save As...

    ... will play with this eventually.
  • I think this (^^^) would be the easiest in the long run. However, if you had to extract the sample hits something like this could work...

    CYL6       =FEAT/CONTACT/CYLINDER/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<0,0,0>,<0,0,1>,0.5,0.375
                ACTL/<0,0,0>,<0,0,1>,0.5,0.375
                TARG/<0,0,0>,<0,0,1>
                START ANG=0,END ANG=360
                ANGLE VEC=<1,0,0>
                DIRECTION=CCW
                REPORT VEC=<0.2706061,0.653305,0.707082>
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=YES
                  NUMHITS=6,NUMLEVELS=2,DEPTH=0.2,END OFFSET=1,PITCH=0
                  SAMPLE METHOD=SAMPLE_HITS
                  SAMPLE HITS=3,SPACER=0.25
                  AVOIDANCE MOVE=BOTH,DISTANCE=0.375
                  FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                SHOW HITS=NO
                ASSIGN/V1=GETTEXT("SAMPLE_HIT_THEO_X",1,{CYL6})
                ASSIGN/V2=GETTEXT("SAMPLE_HIT_THEO_Y",1,{CYL6})
                ASSIGN/V3=GETTEXT("SAMPLE_HIT_THEO_Z",1,{CYL6})
                ASSIGN/V4=GETTEXT("SAMPLE_HIT_THEO_I",1,{CYL6})
                ASSIGN/V5=GETTEXT("SAMPLE_HIT_THEO_J",1,{CYL6})
                ASSIGN/V6=GETTEXT("SAMPLE_HIT_THEO_K",1,{CYL6})
                ASSIGN/V7=GETTEXT("SAMPLE_HIT_MEAS_X",1,{CYL6})
                ASSIGN/V8=GETTEXT("SAMPLE_HIT_MEAS_Y",1,{CYL6})
                ASSIGN/V9=GETTEXT("SAMPLE_HIT_MEAS_Z",1,{CYL6})
    F1         =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                NOM/XYZ,<V1,V2,V3>,$
                MEAS/XYZ,<V7,V8,V9>,$
                NOM/IJK,<V4,V5,V6>,$
                MEAS/IJK,<V4,V5,V6>
    DIM LOC1= LOCATION OF POINT F1  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
    X       0.5000     0.0020    -0.0020     0.5000     0.0000     0.0000 ----#----
    Y       0.0000     0.0020    -0.0020     0.0000     0.0000     0.0000 ----#----
    Z       0.0000     0.0020    -0.0020     0.0000     0.0000     0.0000 ----#----
    END OF DIMENSION LOC1

    This only gets the first sample hit. You would need to repeat as needed for whatever number of sample hits you have. Just increment the index number ( "1" in this case and immediately before the feature label reference). Seems like a lot of work though.


    Here is the Generic Sample Points using GETTEXT("SAMPLE_HIT_THEO_X",1,{CYL6})
    
    
    '***** Live Generic Sample Point Generation
    Fcntr = 0
    If button = 3 Then
      Set PCDCommand = PCDCommands.Item(FeatureList(Dlg1.Listbox)) 
      Set PCDFeatCmd = PCDCommand.FeatureCommand
      numhits = PCDFeatCmd.PermHits
      Set prbhit = CreateObject("PCDLRN.PointData")
    For Fcntr = 1 To numhits
      ' Get the probehits - XYZ  
      Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_CENTROID, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP)
      gX = CDbl(prbhit.X)
      gY = CDbl(prbhit.Y)
      gZ = CDbl(prbhit.Z)
      ' Get the probehits - IJK
      Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_VECTOR, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP)
      gI = CDbl(prbhit.X)
      gJ = CDbl(prbhit.Y)
      gK = CDbl(prbhit.Z)
    ' Create Vector points feature "AUTO__VECTOR_HIT" (COMMAND INFORMATION CODE edit screen) 602
    ' Create Cast points feature "CONST__CAST_POINT" (COMMAND INFORMATION CODE edit screen) 517
    ' Create Generic points feature "GENERIC_CONSTUCTION" (COMMAND INFORMATION CODE edit screen) 597
    ' Create Constructed Feature Set "CONST__SET" (COMMAND INFORMATION CODE edit screen) 596 
      Set cmd = PCDCommands.Add(597, True)
      cmd.Marked = True
    'ASSIGN/V1=GETTEXT("SAMPLE_HIT_THEO_X",1,{CIR14})
      'Featurename is "sourcefeaturename-hitnumber" -> PLANE1-1
     'retval = cmd.PutText (PCDCommand.ID & "_F" & Fcntr, ID, 0)
    retval = cmd.PutText (PCDCommand.ID & "_SG" & Fcntr, ID, 0)
      'Result = cmd.SetExpression (PCDCommand.ID & "." & "HIT" & "[" & Fcntr & "]" , REF_ID, 0)
    'pName = PCDCommand.ID & "." & "HIT" & "[" & Fcntr & "]."
    pName = PCDCommand.ID
    
      ' Theo's
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_X""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_X, 0)
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_Y""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_Y, 0)
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_Z""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_Z, 0)
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_I""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_I, 0)
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_J""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_J, 0)
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_K""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_K, 0)
       ' Actl's
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_X""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_X, 0)
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_Y""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_Y, 0)
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_Z""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_Z, 0)
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_I""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_I, 0)
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_J""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_J, 0)
    retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_K""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_K, 0)
     
      PCDPartProgram.RefreshPart
      cmd.ReDraw
      
    Next
    MsgBox "Live Generic Sample Point Generation Complete"
    End If
    '*******