hexagon logo

Set Flag if Dimension Out-of-Tolerance

Here's what I'm trying to do - Display a message, prior to printing results, that says "There are N dimensions out-of-tolerance, do you still want to print the report?" Of course, I could accomplish this by doing a whole lot of computations with expressions, but I'd thought I'd first inquire if PC-DMIS can set a flag, based upon the Dimension command, that I can convert into a counter.
  • Make sure the script command in your partprogram is marked. It is unmarked by default when you insert it.

    Other than that, what error message are you seeing?
  • Make sure the script command in your partprogram is marked. It is unmarked by default when you insert it.

    Other than that, what error message are you seeing?


    It is marked !
    I have this error message :

    "Error executing basic script!
    C:\CMM FILES\SCRIPT BAS\OUTTOL_1.BAS:Main"
  • Hm, ok... Try changing the "Main" in the script call in your partprogram to "CheckOOT" (or change the "CheckOOT()") in the script to "Main()" and try again.

    CS1 =SCRIPT/FILENAME= C:\CMM FILES\SCRIPT BAS\OUTTOL_1.BAS
    FUNCTION/[COLOR="#FF0000"]Main[/COLOR],SHOW=YES,,


    To:

    CS1 =SCRIPT/FILENAME= C:\CMM FILES\SCRIPT BAS\OUTTOL_1.BAS
    FUNCTION/[COLOR="#FF0000"]CheckOOT[/COLOR],SHOW=YES,,
  • Hm, ok... Try changing the "Main" in the script call in your partprogram to "CheckOOT" (or change the "CheckOOT()") in the script to "Main()" and try again.

    CS1 =SCRIPT/FILENAME= C:\CMM FILES\SCRIPT BAS\OUTTOL_1.BAS
    FUNCTION/[COLOR="#FF0000"]Main[/COLOR],SHOW=YES,,


    To:

    CS1 =SCRIPT/FILENAME= C:\CMM FILES\SCRIPT BAS\OUTTOL_1.BAS
    FUNCTION/[COLOR="#FF0000"]CheckOOT[/COLOR],SHOW=YES,,


    It's Working like this ! Thank you!!

    Thanks to VPT.SE and to DPH51 !!
  • So dph51, I tried the assignment I mentionned upon under PC-DMIS 2014, and it works well !!!
    Here are the commands I use at the end of my program :

    But I have another question : Is it possible to visualize the report when we get OOT dims ? Because the report window shows nothing when its finished, we have to click "redraw the report". Is there an automatic command that able to doing this ?


    ASSIGN/V1=0
    ASSIGN/V2=GETPROGRAMINFO("NUMOOT","")
    IF/V2==0
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,AUTO=6,$
    TO_PRINTER=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    TO_EXCEL_OUTPUT=OFF,
    PREVIOUS_RUNS=DELETE_INSTANCES
    END_IF/
    ELSE_IF/V2>0
    C1 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    You have OOT dimensions, try again !
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=OFF,AUTO=3,$
    TO_PRINTER=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    TO_EXCEL_OUTPUT=OFF,
    PREVIOUS_RUNS=DELETE_INSTANCES
    END_ELSEIF/

    Thanks for this by the way. Before, I had the reports print automatically without giving the operator the choice to save or the destination. I used my same print command in the place of yours and now it asks where to save the report. Any advice on this?
  • SOMETHING LIKE THIS?

    ASSIGN/V1=GETPROGRAMINFO("numoot","") ///FIND TOTAL OUT OF TOLERANCE
    IF/V1>0				      ///EVALUATES IF THERE ARE ANY OUT OF TOLERANCE
    GOTO/END			      ///MOVES TO END IF ANY OUT OF TOLERANCE
    END_IF/				      ///IF NO OUT OF TOLERANCE CODE MOVES TO NEXT LINE
    
    (ENTER YOUR PRINT COMMAND HERE)
    
    END        =LABEL/		      ///END OF PROGRAM TETHER