Sub auto()
Dim pcd As Object
Dim pp As Object
Dim cmds As Object
Dim cmd As Object
Dim checktype As Integer
checktype = 602
Dim hang As Integer
hang = Cells(Rows.Count, 1).End(xlUp).Row
Set pcd = CreateObject("PCDLRN.Application.4.2")
Set pp = pcd.ActivePartProgram
Set cmds = pp.Commands
Dim a As Integer
For a = 9 To hang
Set cmd = cmds.LastCommand
cmds.InsertionPointAfter cmd
Set cmd = cmds.Add(checktype, True)
cmd.ReDraw
' Set ÀíÂÛÖµX
RetVal = cmd.PutText(Cells(a, 3), THEO_X, 0)
' Set ÀíÂÛÖµY
RetVal = cmd.PutText(Cells(a, 4), THEO_Y, 0)
' Set ÀíÂÛÖµZ
RetVal = cmd.PutText(Cells(a, 5), THEO_Z, 0)
' Set ÀíÂÛÖµI
RetVal = cmd.PutText(Cells(a, 6), THEO_I, 0)
' Set ÀíÂÛÖµJ
RetVal = cmd.PutText(Cells(a, 7), THEO_J, 0)
' Set ÀíÂÛÖµK
RetVal = cmd.PutText(Cells(a, 8), THEO_K, 0)
' Set ²â¶¨X
RetVal = cmd.PutText(Cells(a, 3), MEAS_X, 0)
' Set ²â¶¨Y
RetVal = cmd.PutText(Cells(a, 4), MEAS_Y, 0)
' Set ²â¶¨Z
RetVal = cmd.PutText(Cells(a, 5), MEAS_Z, 0)
' Set ²â¶¨I
RetVal = cmd.PutText(Cells(a, 6), MEAS_I, 0)
' Set ²â¶¨J
RetVal = cmd.PutText(Cells(a, 7), MEAS_J, 0)
' Set ²â¶¨K
RetVal = cmd.PutText(Cells(a, 8), MEAS_K, 0)
' Set Ä¿±êX
RetVal = cmd.PutText(Cells(a, 3), TARG_X, 0)
' Set Ä¿±êY
RetVal = cmd.PutText(Cells(a, 4), TARG_Y, 0)
' Set Ä¿±êZ
RetVal = cmd.PutText(Cells(a, 5), TARG_Z, 0)
' Set Ä¿±êI
RetVal = cmd.PutText(Cells(a, 6), TARG_I, 0)
' Set Ä¿±êJ
RetVal = cmd.PutText(Cells(a, 7), TARG_J, 0)
' Set Ä¿±êK
RetVal = cmd.PutText(Cells(a, 8), TARG_K, 0)
' Set ²âµãÃû
RetVal = cmd.PutText(Cells(a, 2), ID, 0)
' Set Display Hits Item 1 = NO
RetVal = cmd.PutText("NO", DISPLAY_HITS, 1)
' Set Show Details Item 1 = NO
RetVal = cmd.SetToggleString(1, SHOW_DETAILS, 1)
' Set Coordinate Type = RECT
RetVal = cmd.SetToggleString(1, COORD_TYPE, 0)
' Set Snap Type = NO
RetVal = cmd.SetToggleString(1, SNAP_TYPE, 0)
' Set Find Nominal Axis = NONE
RetVal = cmd.SetToggleString(1, FIND_NOM_AXIS_TYPE, 0)
' ÒÆ¶¯ÀàÐÍ
RetVal = cmd.SetToggleString(1, MOVE_TYPE, 0)
' ÒÆ¶¯¾àÀë
RetVal = cmd.PutText("0", F_AUTOMOVE, 0)
' ºñ¶ÈÀàÐÍ
RetVal = cmd.SetToggleString(1, THICKNESS_TYPE, 0)
' ºñ¶È
RetVal = cmd.PutText("0", F_THICKNESS, 0)
Next
End Sub