hexagon logo

Tracefields and Scripts

Anyone out there know how to retrieve a Tracefield Value from a part program in a script? Can't quite find the right command...
Parents
  • This is a VB6 example that I have tested -

    Private Sub Form_Load()

    Dim App As PCDLRN.Application
    Dim Part As PCDLRN.PartProgram
    Dim Cmds As PCDLRN.Commands
    Dim Cmd As PCDLRN.Command

    Set App = CreateObject("PCDLRN.Application")
    Set Part = App.ActivePartProgram
    Set Cmds = Part.Commands
    CmdCnt = Cmds.Count

    For Each Cmd In Cmds
    If Cmd.TypeDescription = "Trace Field" Then
    MsgBox Str(Cmd.Type)
    MsgBox Cmd.GetText(TRACE_NAME, 0)
    MsgBox Cmd.GetText(TRACE_VALUE, 0)
    End If
    Next Cmd

    End

    End Sub
Reply
  • This is a VB6 example that I have tested -

    Private Sub Form_Load()

    Dim App As PCDLRN.Application
    Dim Part As PCDLRN.PartProgram
    Dim Cmds As PCDLRN.Commands
    Dim Cmd As PCDLRN.Command

    Set App = CreateObject("PCDLRN.Application")
    Set Part = App.ActivePartProgram
    Set Cmds = Part.Commands
    CmdCnt = Cmds.Count

    For Each Cmd In Cmds
    If Cmd.TypeDescription = "Trace Field" Then
    MsgBox Str(Cmd.Type)
    MsgBox Cmd.GetText(TRACE_NAME, 0)
    MsgBox Cmd.GetText(TRACE_VALUE, 0)
    End If
    Next Cmd

    End

    End Sub
Children
No Data