hexagon logo

Variable in Output File Name Issue - Followed Hexagon's Guide

Hi everyone,

I'm trying to utilize a variable in my program to change the file name when outputting the report. I followed the Hexagon guide I linked to below, but if I close and reopen the program, it removes the variable name I put in the output box and replaces it with whatever it was on the previous run. Any idea why that's happening?

Edit: forgot to add, I'm using PC-DMIS CAD 2018 R2 Build#504 SP8
Edit 2: forgot code.

C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
            CMM OPERATOR
C2         =COMMENT/INPUT,NO,FULL SCREEN=NO,
            WORK ORDER
C3         =COMMENT/INPUT,NO,FULL SCREEN=NO,
            -THRU-
            ASSIGN/PROG_NAME=GETPROGRAMINFO ("PARTNAME")
            ASSIGN/OP=C1.INPUT
            ASSIGN/WO=C2.INPUT
            ASSIGN/THRU=C3.INPUT
            ASSIGN/REPORT_NAME="R:\\XXXX\\XXXXX\\CMM\\"+PROG_NAME+"_"+WO+"_"+THRU+".RTF"​


{"alt":"Click image for larger version Name:\tREPORTNAME.png Views:\t0 Size:\t20.8 KB ID:\t528181","data-align":"none","data-attachmentid":"528181","data-size":"custom","height":"263","title":"REPORTNAME.png","width":"360"}​​

Output to a File Using Expressions
https://docs.hexagonmi.com/pcdmis/2022.2/en/helpcenter/mergedProjects/core/04_file_bas_topics/Output_to_a_File_Using_Expressions.htm

Parents
  • I was able to isolate what was causing the problem. The code and the variable works fine and repeats even after closing the program and re-opening - BUT if I have the report window open and I press the "print report" icon, that is when the file output name gets changed from the variable name (REPORT_NAME) to the last used name/path. Otherwise If I run, close, re-open, etc it will still have "REPORT_NAME" in the field and work as intended. It's only when pressing the print report icon that it changes and "breaks" the variable reference so to speak. Odd isn't it?
Reply
  • I was able to isolate what was causing the problem. The code and the variable works fine and repeats even after closing the program and re-opening - BUT if I have the report window open and I press the "print report" icon, that is when the file output name gets changed from the variable name (REPORT_NAME) to the last used name/path. Otherwise If I run, close, re-open, etc it will still have "REPORT_NAME" in the field and work as intended. It's only when pressing the print report icon that it changes and "breaks" the variable reference so to speak. Odd isn't it?
Children
No Data