Saving enter serial no entered by operator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Saving enter serial no entered by operator

    I know how to insert print command.

    there is a way using variables i.e

    comment/input

    c1.input.pdf

    v1=c1.input

    i used to do this all the time..... but have now forgot as i havent used this command in a long time


    print command in put
    append etc etc
    so it would go c/drive/folder/ part no/ c1(serial no).pdf

    or so it would go c/drive/folder/ part no/ v1.pdf

    i cant get it to work.....

    what is the correct code.

    please post

  • #2
    If you have 2020 R1 or later, look at the "Report Archiving" example routine on the discover tab of the home page.
    Neil Challinor
    PC-DMIS Product Owner

    T: +44 870 446 2667 (Hexagon UK office)
    E: [email protected]

    Comment


    • #3
      You have to assign your variable the entire file path. If the op only needs to put in the serial number, then it'll be:

      assign v1 = c1.input
      assign v2 = "c:\folder\part no\\" + v1 + ".pdf"

      then plug v2 into the print command -- append = v2
      also make sure your TO_FILE = ON
      Last edited by Sora5; 12-10-2020, 01:28 PM. Reason: edit v2 from \ to \\

      Comment


      • neil.challinor
        neil.challinor commented
        Editing a comment
        You may find that you need to use \\ rather than \ in your file path as well.

      • Sora5
        Sora5 commented
        Editing a comment
        You're correct. I have \\ in my program code. I must have only highlighted 1 \ when I copied and paste.

    • #4
      I think it will have to be:
      assign v1 ="\ "+ c1.input
      assign v2 = "c:\folder\part no" + v1 + ".pdf"

      It doesn't like the \ at the end of a quote.
      Last edited by BKulpa; 12-10-2020, 11:57 AM.

      Comment


      • #5
        This is how I achieve this.

        Code:
        ASSIGN/FILENAME="LH__part name "+SERNO.INPUT+".TXT"
        ASSIGN/REPORTPATH="C:\user\Quality\CMM Lab\Measured Reports\Autosave reports\part name\LH\\"
        ASSIGN/PRINTVAR=REPORTPATH+FILENAME
        
        PRINT/REPORT,EXEC MODE=END,$
        TO_FILE=ON,OVERWRITE=PRINTVAR,AUTO OPEN=OFF,$
        TO_PRINTER=OFF,COPIES=1,$
        TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
        REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
        TO_EXCEL=OFF,$
        PREVIOUS_RUNS=DELETE_INSTANCES
        Serno.input being the manual input from our operators. PRINTVAR would be the file path and the name of the file. Set the print command to overwrite and pull the path from the PRINTVAR variable. This of course only works if you don't have reoccurring serial numbers as it will overwrite any files with the same name. We use this to autosave all of our reports. Just change the .TXT to .PDF and make sure your print command is set to PDF as well.

        Comment


        • #6
          There is a start program (metric and inch) and an OTOL batch file that will let you set your file paths and a few other tidbits here
          Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
          Contura Calypso 5.4

          Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

          Comment


          • #7
            C1 =COMMENT/INPUT,NO,FULL SCREEN=NO,
            Enter P/O No
            C2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
            Enetr Serial No







            ASSIGN/SAVE_AS="C:\USERS\PUBLIC\DOCUMENTS\HEXAGON\PC-DMIS\2020 R2\" +C1.INPUT+ " - " +C2.INPUT+ "_OP10.PDF"
            PRINT/REPORT,EXEC MODE=END,$
            TO_FILE=ON,APPEND=SAVE_AS,AUTO OPEN=OFF,$
            TO_PRINTER=OFF,COPIES=1,$
            TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
            REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
            TO_EXCEL=OFF,$
            PREVIOUS_RUNS=DELETE_INSTANCES

            Comment


            • #8
              Legends!!!!!

              Comment

              Related Topics

              Collapse

              Working...
              X