hexagon logo

Autoname and save file as .pdf

Longtime reader, first-time poster. Thanks to all for the help this forum has provided to me thus far.

I am new to PCDMIS, but an experienced programmer with GeoMeasure (MTI). GeoMeasure is a DMIS language, but vastly different from PCDMIS. I have programmed (10 years) and even taught programming at a local community college (2 yrs). I was away from CMM's for a couple years until I moved to MA from MI last year and took this job, where I first encountered the Demon.

So now that you all have a little background info on me, here is the problem that searching the forum archives has failed to find a solution to.

I had a fixture fabricated that holds up to 16 parts in a 4X4 configuration. I took an existing program that measures a couple hundred points for flatness and created a nested loop to get my vertical and horizontal offsets. I can execute the program without a problem and everything runs fine except for one minor issue: the report needs to print out with a custom report name for each part before the loop completes.

I found a few threads that address using variables to assign the printpath to and then insert the variable into the print command. What I end up with when running is a prompt to save the file (I am not using the print setup from the "file>printing>edit print window setup" dialog box; all of those options are left unchecked). I think the problem may be network related because when I change the file location to the local C: drive, it works flawlessly.

I have attached the program for reference and I appreciate any and all comments that may be helpful.

Also, I am working a 12:30pm to midnight shift and 7:00am-noon on Saturdays, so outside of those hours I may be a bit unresponsive.
Parents
  • This has work for me since 3.7 MR2....

    C1 =COMMENT/INPUT,NO,'Operator Clock Number'
    C2 =COMMENT/INPUT,NO,'Shift'
    ASSIGN/PART=STR(GETTEXT(191,1,{FILEHEDR}))
    ASSIGN/REVI=STR(GETTEXT(192,1,{FILEHEDR}))
    ASSIGN/SERI=STR(GETTEXT(193,1,{FILEHEDR}))
    ASSIGN/STATCNT=STR(GETTEXT(194,1,{FILEHEDR}))
    ASSIGN/DATE=SYSTEMDATE ("MMddyyyy")
    ASSIGN/TIME=SYSTEMTIME ("HHmmss")
    ASSIGN/FILESTORELOCATION="J:\PUBLIC\CMM REPORTS\HEX DEMO BLOCK\_"
    ASSIGN/FILENAME=PART + "_" + DATE + "_" + TIME + ".RTF"
    COMMENT/REPT,"OPERATOR CLOCK NUMBER: " + C1.INPUT
    COMMENT/REPT,"SHIFT: " + C2.INPUT
    ASSIGN/VAL_FILE=FILESTORELOCATION + FILENAME
    COMMENT/REPT,"REPORT FILE LOCATION: " + VAL_FILE
    $$-- Part Program --
    $$-- End of Part Program
    C3 =COMMENT/YESNO,NO,Do you wish to print report?
    IF/C3.INPUT == "YES"
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=VAL_FILE,$
    TO_PRINTER=ON,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    END_IF/
    IF/C3.INPUT == "NO"
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=VAL_FILE,$
    TO_PRINTER=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    END_IF/
Reply
  • This has work for me since 3.7 MR2....

    C1 =COMMENT/INPUT,NO,'Operator Clock Number'
    C2 =COMMENT/INPUT,NO,'Shift'
    ASSIGN/PART=STR(GETTEXT(191,1,{FILEHEDR}))
    ASSIGN/REVI=STR(GETTEXT(192,1,{FILEHEDR}))
    ASSIGN/SERI=STR(GETTEXT(193,1,{FILEHEDR}))
    ASSIGN/STATCNT=STR(GETTEXT(194,1,{FILEHEDR}))
    ASSIGN/DATE=SYSTEMDATE ("MMddyyyy")
    ASSIGN/TIME=SYSTEMTIME ("HHmmss")
    ASSIGN/FILESTORELOCATION="J:\PUBLIC\CMM REPORTS\HEX DEMO BLOCK\_"
    ASSIGN/FILENAME=PART + "_" + DATE + "_" + TIME + ".RTF"
    COMMENT/REPT,"OPERATOR CLOCK NUMBER: " + C1.INPUT
    COMMENT/REPT,"SHIFT: " + C2.INPUT
    ASSIGN/VAL_FILE=FILESTORELOCATION + FILENAME
    COMMENT/REPT,"REPORT FILE LOCATION: " + VAL_FILE
    $$-- Part Program --
    $$-- End of Part Program
    C3 =COMMENT/YESNO,NO,Do you wish to print report?
    IF/C3.INPUT == "YES"
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=VAL_FILE,$
    TO_PRINTER=ON,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    END_IF/
    IF/C3.INPUT == "NO"
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=VAL_FILE,$
    TO_PRINTER=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    END_IF/
Children
No Data