hexagon logo

Dmis Skips Printing Commands?

EDIT: THE SOLUTION TO THIS IS ON PAGE 2




I wrote a bit of code based off of information on this message board for printing at the end of a program.

SAVE       =COMMENT/YESNO,NO,Do you want to save this report?
                            ,This will save a PDF of the report
                            ,on the computer.
            IF/SAVE.INPUT=="YES"
            PRINT/REPORT,EXEC MODE=END,$
              TO_FILE=ON,APPEND=FINALFILENAME,$
              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/
PRINT      =COMMENT/YESNO,NO,Do you want to print a report?
            IF/PRINT.INPUT=="YES"
            PRINT/REPORT,EXEC MODE=END,$
              TO_FILE=OFF,AUTO=1,$
              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/


The variable FINALFILENAME is assigned earlier in the code:

WORKORDER  =COMMENT/INPUT,NO,'Enter the workorder #,
                            ,using a period instead of a slash.'
SERIALNUMBER =COMMENT/INPUT,NO,'Enter the Serial # of the piece being inspected.
                              ,If there is no serial number, leave this blank.'
CLOCKNUMBER =COMMENT/INPUT,NO,'Enter your clock #.'
            ASSIGN/PART=STR(GETTEXT(191,1,{FILEHEDR}))
            ASSIGN/DATE=SYSTEMDATE ("MMddyy")
            ASSIGN/TIME=SYSTEMTIME ("HHmm")
            ASSIGN/FILESTORE="C:\PROGRAM FILES\WAI\PC-DMIS V4.3 MR1\PROGRAM FILES\PROGRAM REPORTS\056-000-460-6\ "
            ASSIGN/FILENAME=PART + "_" + WORKORDER.INPUT + "_" + DATE + "_" + TIME + ".PDF"
            ASSIGN/FINALFILENAME=FILESTORE + FILENAME


I have a program that utilizes marked sets to execute different part operations. All of the marked sets go to the print options at the end. The problem is that when you say YES to print PDF, it just skips over it and moves on. Same thing with YES to the print to Printer. When I hold my mouse over the IF statements, it confirms that it "read" the comment answer as Yes, it just chooses not to execute the PRINT/REPORT statements.

I CAN get it to print to PDF and Printer ONCE. For the PDF print, I just modify the name. Change it to SAVE1. Whatever. And it prints to file, for 1 Execution. For the printer print, I change the printer to another printer and then change it back. And it prints 1 time. AngryAngryAngry

Am I screwing this up somehow with how it is using the variables? Or maybe the marked sets? I am totally lost here, because it worked beautiful in my test program I created.
  • Well, I seem to be able to replicate your problem. Are you placing your cursor in this line



    and using ctrl+u or is it not working when you execute the entire program?

    Because, if I try to ctrl+u from my comment line, it will skip the print command whether it is inside the if/end_if or if it is after it. If I put my cursor in the dimension just before the comment line and ctrl+u from there, it works every time. It also seems to work when I run the entire program.


    It appears I have some more trial and error to do.

    To answer your question, I am not using the Execute program button. I am running marked sets. So it is executing a portion of the code. BUT the dimension I have before the print commands is unmarked (blue, will not run). Maybe this could be causing the PRINT command to skip, as you got it to skip.

    Back to the batcave!
  • Now I have discovered that the PRINT/REPORT bit of code does NOTHING in marked sets. I set one up outside of my IF/ and YESNO comments and tried all sorts of different print options.

    In marked sets, print commands are totally skipped, no matter the context. Wtf?!

    I really hope there is a check box to fix this... Disappointed
  • Can't the "File/printing/report window print setup/Printer:" be used?
  • Yes, but I want to ask the operator if he wants to print and/or save the results of the marked set. So I set up print commands with YES/NO comments and IF/ statements. If I went the File | Printing route to determine print options for a marked set, it would always print and save, and I don't want that to happen.
  • Now I have discovered that the PRINT/REPORT bit of code does NOTHING in marked sets. I set one up outside of my IF/ and YESNO comments and tried all sorts of different print options.

    In marked sets, print commands are totally skipped, no matter the context. Wtf?!

    I really hope there is a check box to fix this... Disappointed


    I saw that issue too. Again, it seemed to have to do with if I was executing the dimension previous to the print command.

    Can you throw in a 'dummy' dimension that will always be marked? Something like create a point at the origin and dimension it's location. Nominal will be 0 and it will always measure 0 so it will never show up as out of tolerance.
  • I made up a program yesterday with some dummy dimensions in it, and no matter what, print options are skipped in marked sets. I ended up putting in an acutal measured plane in the program and dimensioning it...and it still skipped all print options.

    I might have done the code wrong, also, by putting in two print commands, one after the other, with delete instances on, so I switched it to 1 print command and did the operator comments a little differently. This would keep it from saving a PDF fine and then printing nothing out on a report because of delete instances on the PDF print option...i think. It is kind of a moot point if print options do not work at all in marked sets....
  • I think what might be the problem is this, first off go to file>printing>print setup. Make sure that no options are checked for execution (paper or pdf printing). Then go to the MARKED SETS window and you have a print report option in the marked set window right? Right click on that and make sure that nothing is checked for execution.I believe this needs to be done while the marked set in question is highlighted. I have noticed issues with the print option command within a program and using marked sets. I hope this leads to a resolution for you. To be honest I can't remember if this fixed it or not. Best of luck.
  • James, I have spent a lot of time trying to use print commands in the code in Marked sets, and my conclusion is it just plain isn't supported. I have tried every combination possible for global print settings, along with settings specific to individual marked sets (talking about the settings going to File | Printing ...., as you mentioned in the previous post.) No matter what these are set like, any PRINT code in the program is completely skipped in a marked set. PC-DMIS passes right over it without pause.

    Is this something that will be fixed in version 4.4? I believe that you are using the beta right now? I have sunk a considerable amount of time into utilizing marked sets in programs, and now I cannot use advanced printing commands, something that keeps me from creating a complete packaged program for operator use. It is very frustrating.
  • I FINALLY found a way to use these print commands in marked sets. First, I had to turn on print to printer in the global print report settings. Then, select a marked set, and change the individual marked set print report settings to Use Global Settings.

    Then, in order to avoid printing a report no matter what at the end of a marked set execution, go back and turn the print to Printer off in the global print report settings.

    There is no way to select the Use Global Settings box in marked sets unless a global print option is specified, so the box grays out. So setting the marked sets up with a global print option, and then unchecking all global print settings, will leave the Use Global Settings box greyed out, but checked, in individual marked sets.

    This gets PC-DMIS to read the Print code line in marked sets, and doesn't print twice, or fail for one of the inputs.

    That is a fair bit to do to change over my old programs, but at least it's doable. Thought I would share that.