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
  • I guess that will work, but that co  de needs assignments in your partprogram before it can do anything else (VSERIALNUMBER, VDATE, VTIME, VDESCRIPTION).


    Attaching a .png of the issue you just mentioned. When I execute the part program and in turn the script inside the program, I get the error shown in the screenshot. Those values (VSERIALNUMBER...ETC.) are input variables from comments in the part program. The scripting engine tells me that they do not have a default value. I need them to be variable for the script to work like I need it to.

    If this method is not good, then please let me know. I will take any suggestions since this is my first attempt at scripting.

    I just don't know the code well enough yet to know any better...
Reply
  • I guess that will work, but that co  de needs assignments in your partprogram before it can do anything else (VSERIALNUMBER, VDATE, VTIME, VDESCRIPTION).


    Attaching a .png of the issue you just mentioned. When I execute the part program and in turn the script inside the program, I get the error shown in the screenshot. Those values (VSERIALNUMBER...ETC.) are input variables from comments in the part program. The scripting engine tells me that they do not have a default value. I need them to be variable for the script to work like I need it to.

    If this method is not good, then please let me know. I will take any suggestions since this is my first attempt at scripting.

    I just don't know the code well enough yet to know any better...
Children
No Data