hexagon logo

Programmatically add tips to the probes list...

Does anyone know how to programmatically add tips to the probes list? I have tried unsuccessfully, it appears to add the angles as I can see the Active Tip list flash (Green and red boxes in pic) but upon the completion of the VB app I look in the Active Tip list and none of the 'added' tips are there.

PCD 2018R1
VB.net 2019
Dual Arm Bravo

Here is the command I used to add the the tips...

PCDapp.ActivePartProgram.Probes.Item(1).Tips.Add(A_Ang, B_Ang)



I understand that ' Item(1)' is the first probe file in the directory of probe files and that it's 'one based', not 'zero based'...at least based on my experimentation.



Regards,
The FOG
Parents
  • Not sure what you are trying to do, but I was able to successfully remove all the tip angles from the probe utilities for a specific build and add in only the ones I wanted. That part seemed to work pretty good, but I was getting sporadic behavior due to something else going on. Haven’t gotten a chance to come back to it yet. My intentions were to create an auto-calibration routine for my UI. Anyways, here’s how I did it.

    CurrPrb = part.CurrentProbeName
    MsgBox(CurrPrb)
    MsgBox("Got the Probe file name")
    probes = part.Probes
    probes.Visible = True
    probe = probes.Item(CurrPrb)
    If probe.Dialog = True Then
    MsgBox("probe dialog weeeeeeeeee")

    probe.SelectAllTips()
    Tips = probe.Tips
    Tips.Remove(1)


    Dim Replaced1 As String
    Dim Replaced2 As String

    textline = ""
    If System.IO.File.Exists(file_name) = True Then
    Dim objreader As New System.IO.StreamReader(file_name)

    Do While objreader.Peek() <> -1
    Replaced1 = "T1A"
    Replaced2 = "B"

    textline = textline & objreader.ReadLine() & vbNewLine
    textline = Replace(textline, (Replaced1), "")
    textline = Replace(textline, (Replaced2), ",")
    'MsgBox(textline)
    Dim Angle_A As String
    Dim Angle_B As String
    Angle_A = Split(textline, ",")(0)
    Angle_B = Split(textline, ",")(1)
    Tips.Add(Angle_A, Angle_B)

    textline = ""


    Loop
    objreader.Close()
    End If


    probes.SaveChanges()
    probes.Visible = False
    part.EXECUTE()
    part.Close()
    End If
Reply Children
No Data