hexagon logo

VBScript for reports

Hello everyone,

I got a problem.. Slight smile When the measurement ends I want to save report to specific location, depending on where the part was made (we have same part, but we make it on 2 machines)..
I am using PRINT command, but it sometimes saves blank .rtf report for no reason. so I thought, that maybe using script would be better and more secure, but my scripting knowledge is really limited at the moment, since I just started to do scripting.

I tried to get it working with some scripts, but no luck.

Does anyone have any syntax or code example that I could check and make it work ?
Basically, when measurement ends, msgbox opens and you have to choose(checkbox/list/buttons) the destination where it should save report, which has to be .rtf because we use them in some other programs for statistic.

Thank you for help, D.
Parents
  • This is something I use to send files to a network drive. Not sure if you can use something like this. We went paperless & Pdf or use excel dumps. Slight smile

    ASSIGN/DATE1=SYSTEMDATE("MMM dd,yyyy")
    ASSIGN/TIME1=SYSTEMTIME("hh.mm")
    ASSIGN/RPTNAME="S:\CMM Reports\Knees\1048 Forge\JOB#_"+ELEMENT(1,"-",C3.INPUT)+"_Part_"+ELEMENT(1,"-",C2.INPUT)+"_"+DATE1+"_"+TIME1+".PDF"
    C13 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    Did the part pass Inspection?
    IF_GOTO/C13.INPUT=="YES",GOTO = L15
    IF_GOTO/C13.INPUT=="NO",GOTO = L14
    L14 =LABEL/
    C12 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    Do you want to print the cmm report?
    IF_GOTO/C12.INPUT=="YES",GOTO = L17
    IF_GOTO/C12.INPUT=="NO",GOTO = L16
    L16 =LABEL/
    PROGRAM/END
    L17 =LABEL/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=OFF,OVERWRITE=RPTNAME.PDF,$
    TO_PRINTER=ON,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    PROGRAM/END
    L15 =LABEL/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=RPTNAME.PDF,$
    TO_PRINTER=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    PROGRAM/END
Reply
  • This is something I use to send files to a network drive. Not sure if you can use something like this. We went paperless & Pdf or use excel dumps. Slight smile

    ASSIGN/DATE1=SYSTEMDATE("MMM dd,yyyy")
    ASSIGN/TIME1=SYSTEMTIME("hh.mm")
    ASSIGN/RPTNAME="S:\CMM Reports\Knees\1048 Forge\JOB#_"+ELEMENT(1,"-",C3.INPUT)+"_Part_"+ELEMENT(1,"-",C2.INPUT)+"_"+DATE1+"_"+TIME1+".PDF"
    C13 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    Did the part pass Inspection?
    IF_GOTO/C13.INPUT=="YES",GOTO = L15
    IF_GOTO/C13.INPUT=="NO",GOTO = L14
    L14 =LABEL/
    C12 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    Do you want to print the cmm report?
    IF_GOTO/C12.INPUT=="YES",GOTO = L17
    IF_GOTO/C12.INPUT=="NO",GOTO = L16
    L16 =LABEL/
    PROGRAM/END
    L17 =LABEL/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=OFF,OVERWRITE=RPTNAME.PDF,$
    TO_PRINTER=ON,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    PROGRAM/END
    L15 =LABEL/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=RPTNAME.PDF,$
    TO_PRINTER=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    PROGRAM/END
Children
No Data