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 the script I mentioned earlier. It is working on every production part we have run since implementation.

    HOWEVER, THIS SCRIPT WILL NOT RUN IN BLADERUNNER. IT DOES WORK IN PC-DMIS. That's why I mentioned that earilier.

    Sub Main
    
    'Declares the File System Object And Instantiates it
    Dim  objFSO
    Set  objFSO = CreateObject("Scripting.FileSystemObject")
    
    'Declares PC-DMIS As the Active Program/Application
    Dim PCDApp, PCDPartProgram, PCDCommands, PCDCommand, retval
    Set PCDApp = CreateObject("PCDLRN.Application")
    Set Part = PCDApp.ActivePartProgram
    Set PCDCommands = PCDPartProgram.Commands
    
    'Declares Variables from the prg As Objects
    
    Dim VPART As Object
    Dim VDESCRIPTION As Object
    Dim VSERIALNUMBER As Object
    Dim VDATE As Object
    Dim RESULTS As String
    
    
    'Pulls the variables from the prg
    
    Set  VPART = Part.GetVariableValue ("VPART")
    Set  VDESCRIPTION = Part.GetVariableValue ("VDESCRIPTION")
    Set VSERIALNUMBER = Part.GetVariableValue ("VSERIALNUMBER")
    Set VDATE = Part.GetVariableValue ("VDATE")
    
    'Declares the Filepath, Folder, And the Filename As a String
    
    strPath = Part.Path     'Uses the prg path As the path For the folder
    
    
    'Sets the folder Name And the Path For the Folder
    strFolderName = VPART.StringValue & "_" & VDESCRIPTION.StringValue & "_" & VSERIALNUMBER.StringValue & "_" & VDATE.StringValue
    strFolder = strPath & "RESULTS\" & strFolderName
    
    If  objFSO.FolderExists(strFolder) Then  GoTo  labelEnd
    
    'This command creates the folder
    objFolder = objFSO.CreateFolder(strFolder)
    
    labelEnd
        
    
    End Sub
    
Reply
  • This is the script I mentioned earlier. It is working on every production part we have run since implementation.

    HOWEVER, THIS SCRIPT WILL NOT RUN IN BLADERUNNER. IT DOES WORK IN PC-DMIS. That's why I mentioned that earilier.

    Sub Main
    
    'Declares the File System Object And Instantiates it
    Dim  objFSO
    Set  objFSO = CreateObject("Scripting.FileSystemObject")
    
    'Declares PC-DMIS As the Active Program/Application
    Dim PCDApp, PCDPartProgram, PCDCommands, PCDCommand, retval
    Set PCDApp = CreateObject("PCDLRN.Application")
    Set Part = PCDApp.ActivePartProgram
    Set PCDCommands = PCDPartProgram.Commands
    
    'Declares Variables from the prg As Objects
    
    Dim VPART As Object
    Dim VDESCRIPTION As Object
    Dim VSERIALNUMBER As Object
    Dim VDATE As Object
    Dim RESULTS As String
    
    
    'Pulls the variables from the prg
    
    Set  VPART = Part.GetVariableValue ("VPART")
    Set  VDESCRIPTION = Part.GetVariableValue ("VDESCRIPTION")
    Set VSERIALNUMBER = Part.GetVariableValue ("VSERIALNUMBER")
    Set VDATE = Part.GetVariableValue ("VDATE")
    
    'Declares the Filepath, Folder, And the Filename As a String
    
    strPath = Part.Path     'Uses the prg path As the path For the folder
    
    
    'Sets the folder Name And the Path For the Folder
    strFolderName = VPART.StringValue & "_" & VDESCRIPTION.StringValue & "_" & VSERIALNUMBER.StringValue & "_" & VDATE.StringValue
    strFolder = strPath & "RESULTS\" & strFolderName
    
    If  objFSO.FolderExists(strFolder) Then  GoTo  labelEnd
    
    'This command creates the folder
    objFolder = objFSO.CreateFolder(strFolder)
    
    labelEnd
        
    
    End Sub
    
Children
No Data