hexagon logo

help, auto save .prg after run, in a specific location variable.

I have been looking through all the past topics about this. but I am having trouble getting them working. I tried copy and pasting a few of them. and saving them as a .bas file and running the script. but i cant get one to work for me.


i currently already have a script that auto creates a folder from an operator input and saves the cmm report in that folder.

so ideally i want to follow that same train of thought and save a .prg & .cad in that same folder already created.


please advice.

Parents
  • Scrap the string concatenation and hardcode the path to see if it passes through without errors.
  • When I did it like this-

    newname = "Q:\Quality\In Process Inspection Plans\11127-MACHINE\CMM REPORTS\"  & PCDPartProgram.PartName & " - " & SerialNo & ".PRG" 
    


    it worked just fine. I was replacing the "11127-MACHINE" with a variable within the program itself so that I could use the same script for multiple programs. I set up the "PartNo.StringValue" for that purpose. Likewise with the "ObjFolder" because I don't want the program and report stored in the CMM Programs folder- it needs to be stored in a folder named per the Job number assignment and then annotated by the serial number for the specific part in that job, since we usually have at least 5-6 parts to a job. Setting it up with the file path shown above works without a hitch, even down to the serial number annotation at the end of the part number- but it just doesn't go quite as far as I need it to.
Reply
  • When I did it like this-

    newname = "Q:\Quality\In Process Inspection Plans\11127-MACHINE\CMM REPORTS\"  & PCDPartProgram.PartName & " - " & SerialNo & ".PRG" 
    


    it worked just fine. I was replacing the "11127-MACHINE" with a variable within the program itself so that I could use the same script for multiple programs. I set up the "PartNo.StringValue" for that purpose. Likewise with the "ObjFolder" because I don't want the program and report stored in the CMM Programs folder- it needs to be stored in a folder named per the Job number assignment and then annotated by the serial number for the specific part in that job, since we usually have at least 5-6 parts to a job. Setting it up with the file path shown above works without a hitch, even down to the serial number annotation at the end of the part number- but it just doesn't go quite as far as I need it to.
Children
No Data