Can someone tell me why this code wont run

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

  • Can someone tell me why this code wont run

    I've created an input comment above this that has the file location written in it as shown; THE C30 INPUT COMMENT IS "Q:\\CMM REPORTS\\HEXAGON\"
    ASSIGN/V30=C30.INPUT
    ASSIGN/V98=C1.INPUT
    ASSIGN/V99=C2.INPUT
    ASSIGN/FILE_DATE=SYSTEMDATE( "MM.dd.yyyy" )
    ASSIGN/FILE_TIME=SYSTEMTIME( "hh.mm.ss" )
    ASSIGN/FILE_NAME=V98 + " - " + V99 + " - " + FILE_DATE + " _ " + FILE_TIME + " .XLSX"
    ASSIGN/FILE_LOCATION=V30
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=FILE_LOCATION+FILE_NAME.PDF,A UTO 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=ON,
    PREVIOUS_RUNS=DELETE_INSTANCES

    I've tried this many ways and cannot find a solution.
    I've even made droplist but they don't work
    I just need the **** report to be sent to a specific file location via comment.
    idk why its gotta be so rash!

    ASSIGN/V98=C1.INPUT
    ASSIGN/V98=C1.INPUT
    ASSIGN/V99=C2.INPUT
    ASSIGN/FILE_DATE=SYSTEMDATE( "MM.dd.yyyy" )
    ASSIGN/FILE_TIME=SYSTEMTIME( "hh.mm.ss" )
    ASSIGN/FILE_NAME=V98 + " - " + V99 + " - " + FILE_DATE + " _ " + FILE_TIME + " .XLSX"
    ASSIGN/FILE_LOCATION="Q:\\CMM REPORTS\\V98\\"
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=FILE_LOCATION+FILE_NAME.PDF,A UTO 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=ON,
    PREVIOUS_RUNS=DELETE_INSTANCES

    I DID THE ONE ABOVE WITH THE INPUT COMMENT AS HEXAGON
    and it didn't work either.

    It wont send the files to the folders like it's routed.

    THIS ONE WORKS BUT ONLY BECAUSE I MANULLY TYPED IT IN.
    ASSIGN/V98=C1.INPUT
    ASSIGN/V99=C2.INPUT
    ASSIGN/FILE_DATE=SYSTEMDATE( "MM.dd.yyyy" )
    ASSIGN/FILE_TIME=SYSTEMTIME( "hh.mm.ss" )
    ASSIGN/FILE_NAME=V98 + " - " + V99 + " - " + FILE_DATE + " _ " + FILE_TIME + " .XLSX"
    ASSIGN/FILE_LOCATION="Q:\\CMM REPORTS\\HEXAGON\\"
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=FILE_LOCATION+FILE_NAME.PDF,A UTO 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=ON,
    PREVIOUS_RUNS=DELETE_INSTANCES
    Last edited by [email protected]; 05-30-2019, 11:03 AM.

  • #2
    After you have completely concatenated the file name string, place a COMMENT/OPERATOR in the routine and display the value of that variable, FILE_NAME. See what the software thinks it all adds up to

    Comment


    • Ekneel28@gmail.com
      [email protected] commented
      Editing a comment
      Afterwards I highlighted the variable and it does show the correct path.
      yet it doesn't do it.
      I re-checked the file and its not sending it at all.
      it just open up another file and says it cant be saved

    • Don Ruggieri
      Don Ruggieri commented
      Editing a comment
      Highlighted value does not guarantee an identical execution value. Its a long story. . . .

  • #3
    File name is ".XLSX" and you have a FILENAME.PDF ?
    Instead of a coment input, you could use a File/Dialog, to choose the folder with an "element" function

    Comment


    • #4
      Ughh I having computer difficulties today.
      sorry for deleting your comment.
      this forum isn't allowing me to edit my comments or posts.
      So my code does contain the shown missing backslashes.
      sorry they got cut out in the copy/paste

      Comment


      • #5
        you have two conflicting file extensions. This could be an issue.

        further, try another variable to combine the filename before the print command and not perform that IN the print command...see below...


        Code:
        ASSIGN/V30=C30.INPUT
        ASSIGN/V98=C1.INPUT
        ASSIGN/V99=C2.INPUT
        ASSIGN/FILE_DATE=SYSTEMDATE( "MM.dd.yyyy" )
        ASSIGN/FILE_TIME=SYSTEMTIME( "hh.mm.ss" )
        ASSIGN/FILE_NAME=V98 + " - " + V99 + " - " + FILE_DATE + " _ " + FILE_TIME + " .XLSX"
        ASSIGN/FILE_LOCATION=V30
        ASSIGN/FINAL_FILE_LOC=FILE_LOCATION+FILE_NAME
        PRINT/REPORT,EXEC MODE=END,$
        TO_FILE=ON,OVERWRITE=FINAL_FILE_LOC,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=ON,
        PREVIOUS_RUNS=DELETE_INSTANCES
        Ex-Hex

        Comment


        • #6
          I WAS ABLE TO GET THIS TO DO IT.
          And thanks JEFFMAN I changed the .xlsx to pdf. also
          I broke the path down into runnable variables.
          it took them..
          I'm not questioning it any further LOL!
          as long as it works its not broken haha...
          thanks guys!
          AGAIN!

          ASSIGN/V30=C30.INPUT
          ASSIGN/V31="Q:\\CMM REPORTS\"
          ASSIGN/V32=V30+"\"
          ASSIGN/V98=C1.INPUT
          ASSIGN/V99=C2.INPUT
          ASSIGN/FILE_DATE=SYSTEMDATE( "MM.dd.yyyy" )
          ASSIGN/FILE_TIME=SYSTEMTIME( "hh.mm.ss" )
          ASSIGN/FILE_NAME=V98 + " - " + V99 + " - " + FILE_DATE + " _ " + FILE_TIME + " .PDF"
          ASSIGN/FILE_LOCATION=V31+V32
          PRINT/REPORT,EXEC MODE=END,$
          TO_FILE=ON,OVERWRITE=FILE_LOCATION+FILE_NAME.PDF,A UTO OPEN REPORT=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_OUTPUT=ON,
          PREVIOUS_RUNS=DELETE_INSTANCES

          Comment


          • CodeWarrior
            CodeWarrior commented
            Editing a comment
            I noticed the .xlsx extension after JEFMAN pointed that out and facepalmed. Apologies for the mistake in my example

        • #7
          Originally posted by anthony.alfaro View Post
          you have two conflicting file extensions. This could be an issue.

          further, try another variable to combine the filename before the print command and not perform that IN the print command...see below...


          Code:
          ASSIGN/V30=C30.INPUT
          ASSIGN/V98=C1.INPUT
          ASSIGN/V99=C2.INPUT
          ASSIGN/FILE_DATE=SYSTEMDATE( "MM.dd.yyyy" )
          ASSIGN/FILE_TIME=SYSTEMTIME( "hh.mm.ss" )
          ASSIGN/FILE_NAME=V98 + " - " + V99 + " - " + FILE_DATE + " _ " + FILE_TIME + " .XLSX"
          ASSIGN/FILE_LOCATION=V30
          ASSIGN/FINAL_FILE_LOC=FILE_LOCATION+FILE_NAME
          PRINT/REPORT,EXEC MODE=END,$
          TO_FILE=ON,OVERWRITE=FINAL_FILE_LOC,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=ON,
          PREVIOUS_RUNS=DELETE_INSTANCES
          If I have any issues I will add this.
          Thank you!

          Comment


          • #8
            Originally posted by [email protected] View Post
            ASSIGN/V30=C30.INPUT
            ASSIGN/V98=C1.INPUT
            ASSIGN/V99=C2.INPUT
            ASSIGN/FILE_DATE=SYSTEMDATE( "MM.dd.yyyy" )
            ASSIGN/FILE_TIME=SYSTEMTIME( "hh.mm.ss" )
            ASSIGN/FILE_NAME=V98 + " - " + V99 + " - " + FILE_DATE + " _ " + FILE_TIME + " .XLSX"
            ASSIGN/FILE_LOCATION=V30
            PRINT/REPORT,EXEC MODE=END,$
            TO_FILE=ON,OVERWRITE=FILE_LOCATION+FILE_NAME.PDF,A UTO 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=ON,
            PREVIOUS_RUNS=DELETE_INSTANCES
            The .PDF in red is definitely not right - you're asking PC-DMIS for the sub-field .PDF of the variable FILE_NAME (just like CIR1.DIAM), but that doesn't exist, and you have already added a file extension to FILE_NAME (.XLSX in the quoted code, but I note that you have changed it to .PDF later).
            AndersI
            SW support - Hexagon Metrology Nordic AB

            Comment

            Related Topics

            Collapse

            Working...
            X