hexagon logo

Writing probe values

Hi all,
Is it possible to change diameter or offset values of a probe with a code ? (instead of open the probe window / edit / write the values).
Ok, it seems to be dangerous, but it could be useful..... Nauseated face
Parents
  • Here's some "proof of concept" code to show it can be done (tested offline). I was able to call this script from a program during execution (offline) - at the end of the program the tip was modified. Would definitely need online testing to verify that the modifications took effect during program execution. And of course, you'll need to arrange things so they work for what you have in mind.

    Sub[SIZE=2][COLOR=#000000] Main()[/COLOR]
    [/SIZE]Dim pcd As Object
    Dim prg As Object
    Dim pd As Object
    Dim diam As Double
    Dim tip As Object
     
    Set pcd = CreateObject("pcdlrn.application", "")
    Set pd = new pcdlrn.pointdata
    Set prg = pcd.ActivePartProgram
    prg.Probes.Visible = False
    Set tip = prg.Probes("STA6").Tips("T1A0B0")
    'Get tip data
    Set pd = tip.MeasXYZ
    diam = tip.MeasDiam
    'Change tip data
    pd.X = pd.X + 0.001
    pd.Y = pd.Y + 0.002
    pd.Z = pd.Z + 0.003
    diam = diam + 0.004
    'Write tip data And save changes
    Set prg.Probes("STA6").Tips("T1A0B0").MeasXYZ = pd
    prg.Probes("STA6").Tips("T1A0B0").MeasDiam = diam
    prg.Probes.SaveChanges
    EndSub
Reply
  • Here's some "proof of concept" code to show it can be done (tested offline). I was able to call this script from a program during execution (offline) - at the end of the program the tip was modified. Would definitely need online testing to verify that the modifications took effect during program execution. And of course, you'll need to arrange things so they work for what you have in mind.

    Sub[SIZE=2][COLOR=#000000] Main()[/COLOR]
    [/SIZE]Dim pcd As Object
    Dim prg As Object
    Dim pd As Object
    Dim diam As Double
    Dim tip As Object
     
    Set pcd = CreateObject("pcdlrn.application", "")
    Set pd = new pcdlrn.pointdata
    Set prg = pcd.ActivePartProgram
    prg.Probes.Visible = False
    Set tip = prg.Probes("STA6").Tips("T1A0B0")
    'Get tip data
    Set pd = tip.MeasXYZ
    diam = tip.MeasDiam
    'Change tip data
    pd.X = pd.X + 0.001
    pd.Y = pd.Y + 0.002
    pd.Z = pd.Z + 0.003
    diam = diam + 0.004
    'Write tip data And save changes
    Set prg.Probes("STA6").Tips("T1A0B0").MeasXYZ = pd
    prg.Probes("STA6").Tips("T1A0B0").MeasDiam = diam
    prg.Probes.SaveChanges
    EndSub
Children
No Data