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
  • Sub Main
    
    'Declares the File System Object And Instantiates it
    Dim  objFSO
    Set  objFSO = CreateObject("Scripting.FileSystemObject")
    Dim Count As Integer
    
    
    'Declares PC-DMIS As the Active Program/Application
    Dim PCDApp, Part, Cmds, Cmd, TCmd As Object
    Set PCDApp = CreateObject("PCDLRN.Application")
    Set Part = PCDApp.ActivePartProgram
    Set Cmds = Part.Commands
    
    For Each Cmd In Cmds
           [COLOR=#ff0000]If Cmd.Type = 191 Then 'Think this is the tracefield type number
    
                TCmd = Cmd.gettext(TRACE_VALUE, 1)[/COLOR]
               
               Count=Count+1
           End If 
         Next Cmd


    Am I on the right track with this? I keep getting a type mismatch error with the If line ("If Cmd.IsTraceFieldCommand Then")


    Something like this maybe??
Reply
  • Sub Main
    
    'Declares the File System Object And Instantiates it
    Dim  objFSO
    Set  objFSO = CreateObject("Scripting.FileSystemObject")
    Dim Count As Integer
    
    
    'Declares PC-DMIS As the Active Program/Application
    Dim PCDApp, Part, Cmds, Cmd, TCmd As Object
    Set PCDApp = CreateObject("PCDLRN.Application")
    Set Part = PCDApp.ActivePartProgram
    Set Cmds = Part.Commands
    
    For Each Cmd In Cmds
           [COLOR=#ff0000]If Cmd.Type = 191 Then 'Think this is the tracefield type number
    
                TCmd = Cmd.gettext(TRACE_VALUE, 1)[/COLOR]
               
               Count=Count+1
           End If 
         Next Cmd


    Am I on the right track with this? I keep getting a type mismatch error with the If line ("If Cmd.IsTraceFieldCommand Then")


    Something like this maybe??
Children
No Data