hello i would like the function i want a print yes or no
and that you can tell that you only get the mistakes a report with mitutoyo this is easy
there a already solutions in PC-DMIS to get an YES/NO - command to print.
One possibility is to use form reports.Here you have very free possibilities to fill different variables.
Another (easier) way is to use tracefields with PC-DMIS 2018 R1 or newer.
Here you have the possibility to create dropdown menus with YES or NO.
You can use this selection at an IF/EndIf-Command to start a print process or not.
Please take a look at the attached picture, here you can see an example.
Or use comment command.
The New Tracefield method that is shown here will only work for 2018 R1.
If you open this in a older version then the other Value that was added "Yes" will have to be added back to the Tracefield after the program is open in 2018 R1. Hopefully this will be fixed in the up coming service pack.
I forgot to add something. So far I do like the New Tracefield for 2018 R1.
yes it works
only I am having the problem that I always want to save my document and print when necessary
Giving a print job twice, he does not get the 2nd one is empty
That's because the first Print command clears the report after saving the report to a file. The next Print Command will not print if the report is blank. You can add a script after each print command that has a code to refresh the report.
My Template for PC-DMIS is now over 6,000 lines of code when Groups are expanded and 90 percent of this code is to deal with the lack of reporting controls in PC-DMIS.
This is one of many issues or weakness with PC-DMIS Reporting and should have been fixed years ago.
Here is the Refresh Report Script.
Dim App As ObjectSet App = createobject("pcdlrn.application")Dim Part As ObjectSet Part = App.activepartprogramDim Cmds As ObjectSet Cmds = Part.CommandsDim Cmd As ObjectSet ReportWindow = Part.ReportWindow
Dim ReFrw As ObjectSet ReFrw = Part.ReportWindow
'Full Report Mode'lngRetVal = ReportWindow.FullReportMode()
'Last Execution Report ModelngRetVal = ReportWindow.LastExecutionReportMode()
Set ReportWindow = NothingSet EditWindow = NothingSet DmisPart = NothingSet DmisApp = Nothing End Sub
It is correct that the reports gets blanked after the print command,
but this is not a problem, you can do this for sure and you need no
additional dimensions or scripts :)
You should only work with IF/END IF and ELSE/END ELSE command.
In your example you can create it like the following style:
- IF COMMAND (for example GETTRACE..........=="YES")
- PRINT COMMAND (here please check PDF and PRINT)
- END IF
- PRINT COMMAND (here please check only PDF)
- END ELSE
This is no weakness, you should only work correct with the software, then it works without problems ;)
I think we need no additional function here...
Is the answer OK for you, Michael?
If not, you can contact your software support, I think, they can help you.
* It is only a example with the tracefield.
For sure, you can use also form feeds or the principe with a comment YES / NO, which davehocum showed.
Yes, this is the weakness of the reporting in PC-DMIS. Because you shouldn't have do this and it should not have to be this complicated. And yes I already do this in my template as you have shown and more. But the Get trace command has issues with older versions with the new Trace Field.
While we are on the subject is there any plans of improving the reporting for PC-DMIS?
Sorry, I only wanted to help Michael with his problem, because there are some solutions already,
and I thought that he is thinking that there is no solution. Thats the reason, why I said we need no additional function.
If anyone of you wants to get a better / easier solution, then our developer have to decide, if they can do this.
Thank you Tobi for the Examples and info.
Heyit works perfectly I put everything in a subroutine for printing.and for that I save the pdf where I want it
Awesome idea with the subroutine for the printing. I have been thinking about using subroutines to help reduce the size of the template.
the only thing I am now with is that I head 1 protocol that is filled in but after the cript it is completely empty
Here is my Test Sample:
PNT16 =FEAT/POINT,CARTESIAN,NO THEO/<0,0,0>,<0,1,0> ACTL/<0,0,0>,<0,1,0> CONSTR/POINT,ORIGINDIM LOC1= LOCATION OF POINT PNT16 UNITS=IN ,$GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NOAX NOMINAL +TOL -TOL MEAS DEV OUTTOLX 1.0000 0.0020 0.0020 0.0000 -1.0000 0.9980 <--------Y 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ----#----Z 0.0000 0.0020 0.0020 0.0000 0.0000 0.0000 ----#----END OF DIMENSION LOC1CS1 =CALLSUB/PRINTING_REPORT,C:\Users\Public\Documents\New Programs\Testing Printing 2016.0.PRG:,
SUBROUTINE/PRINTING_REPORT, = CONTINUE_PRINTING_C1 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO, Do want to Print the Report? Select Yes to print the Report. Select No to continue without printing the Report. Select Cancel to End Program IF/CONTINUE_PRINTING_C1.INPUT=="YES" ASSIGN/OUTTOL_PRINT_V1=GETPROGRAMINFO("NUMOOT") IF_GOTO/OUTTOL_PRINT_V1.INPUT==0,GOTO = SKIP_OUTTOL_PRINTING_L1CONTINUE_PRINTING_OUTTOL_C1 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO, Do want to Print the Out of Tolerance Report? Select Yes to print the Report. Select No to continue without printing the Report. Select Cancel to End Program IF_GOTO/CONTINUE_PRINTING_OUTTOL_C1.INPUT =="NO",GOTO = SKIP_OUTTOL_PRINTING_L1 $$ NO, OUTTOL PRINTER PRINT/REPORT,EXEC MODE=END,$ TO_FILE=ON,OVERWRITE=C:\TEMP\Testing 2016.0.PDF,AUTO OPEN REPORT=OFF,$ TO_PRINTER=ON,COPIES=1,$ TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$ REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$ TO_EXCEL_OUTPUT=OFF, PREVIOUS_RUNS=DELETE_INSTANCESCS1 =SCRIPT/FILENAME= C:\USERS\PUBLIC\DOCUMENTS\PCDMISQUICKTOOLS\QUICKTOOLS\REFRESHREPORT NEW.BAS FUNCTION/Main,SHOW=YES,, STARTSCRIPT/ ENDSCRIPT/SKIP_OUTTOL_PRINTING_L1 =LABEL/ $$ NO, AUTO FILE SAVE PRINT/REPORT,EXEC MODE=END,$ TO_FILE=ON,AUTO=11,AUTO OPEN REPORT=OFF,$ TO_PRINTER=OFF,COPIES=1,$ TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$ REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$ TO_EXCEL_OUTPUT=OFF, PREVIOUS_RUNS=DELETE_INSTANCESCS2 =SCRIPT/FILENAME= C:\USERS\PUBLIC\DOCUMENTS\PCDMISQUICKTOOLS\QUICKTOOLS\REFRESHREPORT NEW.BAS FUNCTION/Main,SHOW=YES,, STARTSCRIPT/ ENDSCRIPT/ END_IF/ ENDSUB/END_PROGRAM_L1=LABEL/
can you email the sample i cant koppie past it
More examples with issues using Print Commands.Two Reports in On Routine?
Customer support service by UserEcho