hexagon logo

Perimeter Scan

Hello all,
I'm trying to extract the xyz values from a perimeter scan edge hit.
I'm having trouble navigating down the object hierarchy.
I see a PCDSCANHITTYPE and PCD_EDGEHIT, but
I don't know enough to get the xyz values into variables.

Any help would be appreciated.

Thanks in advance.
Parents
  • Hello Henniger123,
    I did something like that.
    This was just a test to output the xyz's to a file.

    Open "H:\sc.bas" FOR OUTPUT AS #1

    For each Cmd in Cmds

    IF Cmd.Type = BASIC_SCAN_OBJECT then
    For iCount = 1 To Cmd.GetText (N_HITS, 0)
    xm = Cmd.GetText(MEAS_X, iCount)
    ym = Cmd.GetText(MEAS_Y, iCount)
    zm = Cmd.GetText(MEAS_Z, iCount)

    Cmd.Redraw
    PRINT #1, "MOVE/POINT,NORMAL,<",xm,",",ym,",",zm,">"

    Next iCount
    END IF

    Next Cmd

    CLOSE #1

    I would like to be able to add those move points to the end of the
    program with something like

    Set Cmd = Cmds.Add(MOVE_POINT, TRUE)
    Cmd.SetToggleString 1, NORM_RELEARN, 0
    Cmd.PutText Xm, THEO_X, 0
    Cmd.PutText Ym, THEO_Y, 0
    Cmd.PutText Zm, THEO_Z, 0

    but I can't seem to squeeze that into the loop correctly.
    Maybe cause code is pointing to another Cmd?

    That would be the icing on the cake to add that.
    Thanks again.​
Reply
  • Hello Henniger123,
    I did something like that.
    This was just a test to output the xyz's to a file.

    Open "H:\sc.bas" FOR OUTPUT AS #1

    For each Cmd in Cmds

    IF Cmd.Type = BASIC_SCAN_OBJECT then
    For iCount = 1 To Cmd.GetText (N_HITS, 0)
    xm = Cmd.GetText(MEAS_X, iCount)
    ym = Cmd.GetText(MEAS_Y, iCount)
    zm = Cmd.GetText(MEAS_Z, iCount)

    Cmd.Redraw
    PRINT #1, "MOVE/POINT,NORMAL,<",xm,",",ym,",",zm,">"

    Next iCount
    END IF

    Next Cmd

    CLOSE #1

    I would like to be able to add those move points to the end of the
    program with something like

    Set Cmd = Cmds.Add(MOVE_POINT, TRUE)
    Cmd.SetToggleString 1, NORM_RELEARN, 0
    Cmd.PutText Xm, THEO_X, 0
    Cmd.PutText Ym, THEO_Y, 0
    Cmd.PutText Zm, THEO_Z, 0

    but I can't seem to squeeze that into the loop correctly.
    Maybe cause code is pointing to another Cmd?

    That would be the icing on the cake to add that.
    Thanks again.​
Children
No Data