hexagon logo

Code to mark/unmark out of tolerance dimensions

I am trying to figure out a way to automatically mark or unmark feature dimensions that are out of tolerance.
I have a program that includes some if/then statements where it re-measures a diameter at a different depth if the first one is OOT.
So my problem is that in the reporting portion of the program, I want the program to only reflect the in tolerance measurement and not the failed measurements.

I can post the code if it helps.
I am slightly familiar with using vb scripts.


  • I haven't tested this, but I would trap it at the feature and do an immediate remeasure.

    ASSIGN/MDEPTH=.125
    REMEAS1    =LABEL/
    CIR1       =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                THEO/<-1.0273,0.95,-0.5218>,<0,0,-1>,0.776
                ACTL/<-1.0273,0.95,-0.5218>,<0,0,-1>,0.78
                TARG/<-1.0273,0.95,-0.5218>,<0,0,-1>
                START ANG=0,END ANG=360
                ANGLE VEC=<-1,0,0>
                DIRECTION=CCW
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=YES
                  NUMHITS=7,DEPTH=MDEPTH,PITCH=0
                  SAMPLE METHOD=SAMPLE_HITS
                  SAMPLE HITS=3,SPACER=0
                  AVOIDANCE MOVE=NO,DISTANCE=0.3937
                  FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                SHOW HITS=NO
                IF/ABS(CIR1.D-CIR1.TD)>.005
                IF_GOTO/MDEPTH==.375,GOTO = SKIP1
                ASSIGN/MDEPTH=.375
                GOTO/REMEAS1
                END_IF/
    SKIP1      =LABEL/
  • Thanks that is probably the better way to go about it in that particular situation.

    Maybe in my proham I am looking at it in the wrong way. The first two dimensions in the code output are set to "STATS". At the end of the program the dimension code output is set to "REPORT". My problem is that I want to hide the out of tolerance dimension at the end and display the recheck or vice versa.

    I'll show you the code to help.


    CABLEFACE1 =FEAT/PLANE,CARTESIAN,TRIANGLE
    THEO/<-10.417,112.878,-10.121>,<0.9394455,-0.2160752,-0.2659955>
    ACTL/<-10.115,112.825,-10.206>,<0.9361055,-0.231182,-0.2650686>
    MEAS/PLANE,6
    HIT/BASIC,NORMAL,<-1.71,133.11,4.197>,<0.9394455,-0.2160752,-0.2659955>,<-1.14,132.993,4.034>,USE THEO=YES
    HIT/BASIC,NORMAL,<-2.057,122.079,11.934>,<0.9394455,-0.2160752,-0.2659955>,<-1.595,121.991,11.804>,USE THEO=YES
    HIT/BASIC,NORMAL,<-10.97,106.679,-7.036>,<0.9394455,-0.2160752,-0.2659955>,<-10.751,106.645,-7.095>,USE THEO=YES
    HIT/BASIC,NORMAL,<-11.107,116.591,-15.573>,<0.9394455,-0.2160752,-0.2659955>,<-10.731,116.521,-15.681>,USE THEO=YES
    HIT/BASIC,NORMAL,<-18.462,105.472,-32.518>,<0.9394455,-0.2160752,-0.2659955>,<-18.261,105.441,-32.578>,USE THEO=YES
    HIT/BASIC,NORMAL,<-18.198,93.338,-21.728>,<0.9394455,-0.2160752,-0.2659955>,<-18.214,93.358,-21.721>,USE THEO=YES
    ENDMEAS/

    CABPROF1 =SURFACE PROFILE : CABLEFACE1
    FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
    CADGRAPH=OFF,REPORTGRAPH=OFF,TEXT=OFF,MULT=0.00,ARROWDENSITY=100,OUTPUT=STATS,UNITS=MM
    COMPOSITE=NO,
    CUSTOMIZED DRF=NO
    STANDARDTYPE=ASME_Y14_5
    PRIMARY DIMENSION/PROFILE OF SURFACE,1,<UZ>,<UTol>,A,B,C,<MC>
    NOTE/CABPROF1
    FEATURES/CABLEFACE1,,

    IF/CABPROF1.OUTTOL>0
    GOTO/FAIL6
    END_IF/
    IF/CABPROF1.OUTTOL<1
    GOTO/PASS6
    END_IF/

    FAIL6 =LABEL/

    CABLEFACE2 =FEAT/PLANE,CARTESIAN,TRIANGLE
    THEO/<-5.1,120.672,2.327>,<0.9394455,-0.2160752,-0.2659955>
    ACTL/<-5.79,119.756,2.252>,<0.9377972,-0.2261805,-0.2633987>
    MEAS/PLANE,3
    HIT/BASIC,NORMAL,<-2.118,131.739,3.87>,<0.9394455,-0.2160752,-0.2659955>,<-2.704,130.801,3.757>,USE THEO=YES
    HIT/BASIC,NORMAL,<-2.72,117.958,12.94>,<0.9394455,-0.2160752,-0.2659955>,<-3.454,117.066,12.877>,USE THEO=YES
    HIT/BASIC,NORMAL,<-10.464,112.317,-9.829>,<0.9394455,-0.2160752,-0.2659955>,<-11.212,111.401,-9.879>,USE THEO=YES
    ENDMEAS/

    PASS6 =LABEL/

    QCI #7 =SURFACE PROFILE : CABLEFACE1
    FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
    CADGRAPH=BOTH,REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00,ARROWDENSITY=100,OUTPUT=BOTH,UNITS=MM
    COMPOSITE=NO,
    CUSTOMIZED DRF=NO
    STANDARDTYPE=ASME_Y14_5
    PRIMARY DIMENSION/PROFILE OF SURFACE,1,<UZ>,<UTol>,A,B,C
    NOTE/QCI #7
    FEATURES/CABLEFACE1,,

    QCI #7 - RECHECK =SURFACE PROFILE : CABLEFACE2
    FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
    CADGRAPH=BOTH,REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00,ARROWDENSITY=100,OUTPUT=BOTH,UNITS=MM
    COMPOSITE=NO,
    CUSTOMIZED DRF=NO
    STANDARDTYPE=ASME_Y14_5
    PRIMARY DIMENSION/PROFILE OF SURFACE,1,<UZ>,<UTol>,A,B,C
    NOTE/QCI #7 - RECH2 - RECH2
    FEATURES/CABLEFACE2,
  • If you loop feature and the dimension, wouldn't it update to the latest measurement, e.g. the recheck?
  • I can try that.

    When I execute the program it typically shows every dimension in the code viewing the report whether or not it was skipped
  • But does it print with those dimensions or the updated ones?
  • When I view the report and hit the "View Last Exectued" button it hides the recheck dimension if I put it inside the loop. That seems to work for me.

    The next thing I'll have to figure out how to format my report to be in the correct order again.
  • The best way to achieve that is to flush the report & have your dimensions at the bottom
    (That's how I do it anyway)
  • I am trying to figure out a way to automatically mark or unmark feature dimensions that are out of tolerance.
    I have a program that includes some if/then statements where it re-measures a diameter at a different depth if the first one is OOT.
    So my problem is that in the reporting portion of the program, I want the program to only reflect the in tolerance measurement and not the failed measurements.

    I can post the code if it helps.
    I am slightly familiar with using vb scripts.





    I'm sure you know but if it measures out of tolerance at any depth it's out of tolerance right?
  • Yes, I was using that as a basic example. Typically in my situation, I will have a datum plane with target diameters of where to pick it up and it has a profile dimension. Due to the parts having some variance with welds and other things, I will have it measure in different spots in the target zones to achieve a good result which the customer is ok with. I just want to clean the report up for the operators and engineers so it doesn't show the bad initial reading or the rechecks if they weren't exectuted
  • Are you able to just take manual hits for those features and do away with that entirely?
    EDIT:
    Maybe take a manual point on where to start and DCC from there, or something, I mean