hexagon logo

Using script to create folder for prg and save part program

Been reading up on the script manual (PC-DMIS) 3.6 Basic Language Reference Manual) trying to figure out how to get the script to create a folder for the report, the .prg, and any other files associated with the program by serial number of the part.

For example:
PART#_DESCRIPTION_SERIAL#_DATE_TIME

The goal is to write a script contained in the .prg that, upon execution of the part program, will create a folder in a specified directory with the variable filename using the inputs from the part program and save the .prg with the same name.

How would I pass the information from the operator inputs of the part program into the script to make this happen?
Parents
  • Sub Main
    
    ' THIS SECTION DECLARES THE VARIABLES For THE FILENAME SAVE And FOLDER CREATE
    ' "SET" DECLARES THE VALUE OF THE VARIABLES
    ' "PART.GETVARIABLEVALUE" PULLS THE VARIABLE VALUE FROM THE .PRG UPON EXECUTION
    
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    
    Dim Part As Object
    Set Part = App.ActivePartProgram
    
    'Declares PartProg As the Active part program
    Dim PartProg As Object
    Set PartProg = App.ActivePartProgram
    
    Dim Cmds As Object
    Set Cmds = Part.Commands
    
    Dim  VSERIAL As Object
    Set VSERIAL = PART.GETVARIABLEVALUE ("VSERIALNUMBER")
    
    Dim  VDATE As Object
    Set VDATE = PART.GETVARIABLEVALUE ("VDATE")
    
    Dim VTIME As Object
    Set VTIME = PART.GETVARIABLEVALUE ("VTIME")
    
    Dim  VPARTNUMBER As Object
    Set VPARTNUMBER = PART.GETVARIABLEVALUE ("VPART")
    
    Dim VDESCRIPTION As Object
    Set VDESCRIPTION = PART.GETVARIABLEVALUE ("VDESCRIPTION")
    
    
    
    
    End Sub

    Would this work for a start? There's a lot of commands in that code that I'm not yet familiar with...
    I will be studying that post for a while.

    Thanks for the help, vpt. You have no idea how much it's appreciated.
Reply
  • Sub Main
    
    ' THIS SECTION DECLARES THE VARIABLES For THE FILENAME SAVE And FOLDER CREATE
    ' "SET" DECLARES THE VALUE OF THE VARIABLES
    ' "PART.GETVARIABLEVALUE" PULLS THE VARIABLE VALUE FROM THE .PRG UPON EXECUTION
    
    Dim App As Object
    Set App = CreateObject("PCDLRN.Application")
    
    Dim Part As Object
    Set Part = App.ActivePartProgram
    
    'Declares PartProg As the Active part program
    Dim PartProg As Object
    Set PartProg = App.ActivePartProgram
    
    Dim Cmds As Object
    Set Cmds = Part.Commands
    
    Dim  VSERIAL As Object
    Set VSERIAL = PART.GETVARIABLEVALUE ("VSERIALNUMBER")
    
    Dim  VDATE As Object
    Set VDATE = PART.GETVARIABLEVALUE ("VDATE")
    
    Dim VTIME As Object
    Set VTIME = PART.GETVARIABLEVALUE ("VTIME")
    
    Dim  VPARTNUMBER As Object
    Set VPARTNUMBER = PART.GETVARIABLEVALUE ("VPART")
    
    Dim VDESCRIPTION As Object
    Set VDESCRIPTION = PART.GETVARIABLEVALUE ("VDESCRIPTION")
    
    
    
    
    End Sub

    Would this work for a start? There's a lot of commands in that code that I'm not yet familiar with...
    I will be studying that post for a while.

    Thanks for the help, vpt. You have no idea how much it's appreciated.
Children
No Data