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.
  • Is there a way to get a message box with the OOT dims to pop up at programs end? Also, can you get it to say "There are ___ dimensions out of tolerance" the ___ being the quantity?


    First part
    yes. Using flow control and logic statements and assignments.

    second part
    maybe. If the version of PCDMIS is V2013 or later.
  • See dph51's answer regarding the first part.

    The second part is doable regardless of version, by using a script that you need to run after program execution.
  • Is there is a list of all the logic statements, assignments and codes somewhere? I am new to using variables and logic and am having a hard time getting the comment box to pull the OOT dimension.
  • You could try the help file...

    Most all information is there, although it can be a bit difficult to guess what word to search on. That's when the Contents tab comes to rescue.

  • See dph51's answer regarding the first part.

    The second part is doable regardless of version, by using a script that you need to run after program execution.


    VPT.se,
    Do you have an example of the script concerned in a program ?
  • 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/
  • This little script will repaint the screen

    Sub Main()'************PC-DMIS declarations************
    Dim pcdApp As Object
    Set pcdApp = CreateObject("PCDLRN.Application")
    
    
    Dim pcdPart As Object
    Set pcdPart = pcdApp.ActivePartProgram
    
    
    Dim pcdReportWindow As Object
    Set pcdReportWindow = pcdPart.ReportWindow
    
    
    'MsgBox "Refreshing Report"
    '***********Repaint the report window*********
    pcdReportWindow.RefreshReport
    
    
    '********************Cleanup**********************
    Set pcdReportWindow = Nothing
    Set pcdPart = Nothing
    Set pcdApp = Nothing
    
    
    End Sub
    
  • VPT.se,
    Do you have an example of the script concerned in a program ?


    I posted a suggestion earlier in this very thread:
    http://www.pcdmisforum.com/showthread.php?21058-Set-Flag-if-Dimension-Out-of-Tolerance&p=324844&viewfull=1#post324844
  • Thank you VPT.se ! Sorry, I didn't pay attention before.
    and Thank you Erikir !

    I will check these two scripts and I keep you informed.
  • I tried these two code : I inserted at the end of the program. I think its right ?

    The code of ERIKIR : Its ok, It seem the visual report updated! I will test more to be sure.

    The code of VPT.se : It can't execute, I have an error message. Maybe somethings missing ? Or somethings wrong ?
    I inser this way (at the end of the program) :

    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_DIMEN SIONS=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_DIMEN SIONS=NO,$
    TO_EXCEL_OUTPUT=OFF,
    PREVIOUS_RUNS=DELETE_INSTANCES
    END_ELSEIF/
    CS1 =SCRIPT/FILENAME= C:\CMM FILES\SCRIPT BAS\OUTTOL_1.BAS
    FUNCTION/Main,SHOW=YES,,
    STARTSCRIPT/
    ENDSCRIPT/