hexagon logo

Print to TEXT and PDF at the same time

Any tips on printing to TEXT and PDF on the same program? (Without having to go in to the Report window print setup every time I change format)
We are using DISCUS and are wanting to keep our report output to pdf standard and then also have an output to text that we can pull in to DISCUS.
I am playing around with the excel output and might just go that route to avoid the headache of not being able to output to text and pdf at the same time.

I have already tried using two print commands in the same program. It didnt work for me.

thanks for the help!
Parents
  • This is what i use to get a PDF and TXT output every time we run a part program.
    You will need to define the file path and naming that you want in the 1st 2 ASSIGN lines.

    The CS1 is the path/location of the BAS that it will use.


    PUT THIS AT END OF PROGRAM
    ASSIGN/PDFPRTSTRING="M:\SM-All Parts (DMS)\Electronic Inspection Results\CUSTOMER NAME"+C1.INPUT+"\\PART NUMBER."+C2.INPUT+"_cmm.PDF"
    ASSIGN/TXTPRTSTRING="M:\SM-All Parts (DMS)\Electronic Inspection Results\CUSTOMER NAME"+C1.INPUT+"\\PART NUMBER."+C2.INPUT+"_cmm.TXT"
    CS1 =SCRIPT/FILENAME= V:\ALLPROGRAMSQC\CMM SCRIPTS\PRINT_TEXT_PDF.BAS
    FUNCTION/Main,SHOW=YES,,
    STARTSCRIPT/
    ENDSCRIPT/
    COMMENT/REPT,
    "RUN TIME: "+T100
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE="M:\SM-All Parts (DMS)\Electronic Inspection Results\CUSTOMER NAME\"+ LOT.INPUT + "\" + FILE_NAME.INPUT + "" + SERIAL.INPUT + "_cmm" + ".PDF",AUTO OPEN REPORT=OFF,$
    TO_PRINTER=ON,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL_OUTPUT=OFF,
    PREVIOUS_RUNS=DELETE_INSTANCES



    THIS IS THE CODE INSIDE THE bas FILE.

    Dim DmisApp As Object Dim DmisPart As Object Dim DmisCommands As Object Dim DmisCommand As Object Dim Var As Object Sub Main() Set DmisApp =CreateObject ("PCDLRN.Application") Set DmisPart = DmisApp.ActivePartProgram Set DmisCommands = DmisPart.Commands Dim defaultreport As String defaultreport = "C:\Users\Public\Documents\Hexagon\PC-DMIS\2017 R2\Reporting\default.rtp" Set Var = DmisPart.GetVariableValue ("TXTPRTSTRING") DmisPart.EditWindow.SetPrintOptionsEx PCD_FILE, DMIS_OFF, PCD_OVERWRITE, 1, Var.StringValue , PCD_TXT, True DmisPart.ReportWindow.LoadReportTemplate defaultreport DmisPart.ReportWindow.FullReportMode DmisPart.ReportWindow.Visible = True DmisPart.ReportWindow.RefreshReport DmisPart.ReportWindow.PrintReport Dim textonly As String textonly = "C:\Users\Public\Documents\Hexagon\PC-DMIS\2017 R2\Reporting\textonly.rtp" Set Var = DmisPart.GetVariableValue ("PDFPRTSTRING") DmisPart.EditWindow.SetPrintOptionsEx PCD_FILE, DMIS_OFF, PCD_OVERWRITE, 1, Var.StringValue , PCD_PDF, True DmisPart.ReportWindow.LoadReportTemplate textonly DmisPart.ReportWindow.FullReportMode DmisPart.ReportWindow.Visible = True DmisPart.ReportWindow.RefreshReport DmisPart.ReportWindow.RefreshReport DmisPart.ReportWindow.PrintReport DmisPart.EditWindow.SetPrintOptionsEx PCD__OFF, DMIS_off, PCD_OVERWRITE, 1, "" , PCD_PDF, False End Sub


    This is not my work it is the work of a Colleague in one of our facilities.

    I forgot to add that this will automatically save both at end of run at what ever location you choose. So you can send each one to a different location.
Reply
  • This is what i use to get a PDF and TXT output every time we run a part program.
    You will need to define the file path and naming that you want in the 1st 2 ASSIGN lines.

    The CS1 is the path/location of the BAS that it will use.


    PUT THIS AT END OF PROGRAM
    ASSIGN/PDFPRTSTRING="M:\SM-All Parts (DMS)\Electronic Inspection Results\CUSTOMER NAME"+C1.INPUT+"\\PART NUMBER."+C2.INPUT+"_cmm.PDF"
    ASSIGN/TXTPRTSTRING="M:\SM-All Parts (DMS)\Electronic Inspection Results\CUSTOMER NAME"+C1.INPUT+"\\PART NUMBER."+C2.INPUT+"_cmm.TXT"
    CS1 =SCRIPT/FILENAME= V:\ALLPROGRAMSQC\CMM SCRIPTS\PRINT_TEXT_PDF.BAS
    FUNCTION/Main,SHOW=YES,,
    STARTSCRIPT/
    ENDSCRIPT/
    COMMENT/REPT,
    "RUN TIME: "+T100
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE="M:\SM-All Parts (DMS)\Electronic Inspection Results\CUSTOMER NAME\"+ LOT.INPUT + "\" + FILE_NAME.INPUT + "" + SERIAL.INPUT + "_cmm" + ".PDF",AUTO OPEN REPORT=OFF,$
    TO_PRINTER=ON,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL_OUTPUT=OFF,
    PREVIOUS_RUNS=DELETE_INSTANCES



    THIS IS THE CODE INSIDE THE bas FILE.

    Dim DmisApp As Object Dim DmisPart As Object Dim DmisCommands As Object Dim DmisCommand As Object Dim Var As Object Sub Main() Set DmisApp =CreateObject ("PCDLRN.Application") Set DmisPart = DmisApp.ActivePartProgram Set DmisCommands = DmisPart.Commands Dim defaultreport As String defaultreport = "C:\Users\Public\Documents\Hexagon\PC-DMIS\2017 R2\Reporting\default.rtp" Set Var = DmisPart.GetVariableValue ("TXTPRTSTRING") DmisPart.EditWindow.SetPrintOptionsEx PCD_FILE, DMIS_OFF, PCD_OVERWRITE, 1, Var.StringValue , PCD_TXT, True DmisPart.ReportWindow.LoadReportTemplate defaultreport DmisPart.ReportWindow.FullReportMode DmisPart.ReportWindow.Visible = True DmisPart.ReportWindow.RefreshReport DmisPart.ReportWindow.PrintReport Dim textonly As String textonly = "C:\Users\Public\Documents\Hexagon\PC-DMIS\2017 R2\Reporting\textonly.rtp" Set Var = DmisPart.GetVariableValue ("PDFPRTSTRING") DmisPart.EditWindow.SetPrintOptionsEx PCD_FILE, DMIS_OFF, PCD_OVERWRITE, 1, Var.StringValue , PCD_PDF, True DmisPart.ReportWindow.LoadReportTemplate textonly DmisPart.ReportWindow.FullReportMode DmisPart.ReportWindow.Visible = True DmisPart.ReportWindow.RefreshReport DmisPart.ReportWindow.RefreshReport DmisPart.ReportWindow.PrintReport DmisPart.EditWindow.SetPrintOptionsEx PCD__OFF, DMIS_off, PCD_OVERWRITE, 1, "" , PCD_PDF, False End Sub


    This is not my work it is the work of a Colleague in one of our facilities.

    I forgot to add that this will automatically save both at end of run at what ever location you choose. So you can send each one to a different location.
Children
No Data