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
  • Dim PCDApp, Part, Cmds, Cmd, TCmd, TCmds As Object
            PCDApp = CreateObject("PCDLRN.Application")
            Part = PCDApp.ActivePartProgram
            Cmds = Part.Commands
            Cmd = Part.Command
            TCmds = Part.TraceFieldCommands
            TCmd = Part.TraceFieldCommand
            Dim VSERIALNUMBER As Object
    
    
            For Each TCmd In TCmds
                If TCmd.Name = "SERIALNUMBER" Then
                    VSERIALNUMBER = TCmd.Value
    
                End If
    
            Next
    

    I've gotten this far with help from the Object Browser in VB. Now it is throwing an object error "object with variable block not set" at the
    "TCmds = Part.TraceFieldCommands" line.
Reply
  • Dim PCDApp, Part, Cmds, Cmd, TCmd, TCmds As Object
            PCDApp = CreateObject("PCDLRN.Application")
            Part = PCDApp.ActivePartProgram
            Cmds = Part.Commands
            Cmd = Part.Command
            TCmds = Part.TraceFieldCommands
            TCmd = Part.TraceFieldCommand
            Dim VSERIALNUMBER As Object
    
    
            For Each TCmd In TCmds
                If TCmd.Name = "SERIALNUMBER" Then
                    VSERIALNUMBER = TCmd.Value
    
                End If
    
            Next
    

    I've gotten this far with help from the Object Browser in VB. Now it is throwing an object error "object with variable block not set" at the
    "TCmds = Part.TraceFieldCommands" line.
Children
No Data