Yeah, it's in swedish but you should be able to follow along...
First, get the value that you want to calculate MMC for, in this particular case a distance between two planes:
UTV [COLOR="#FF0000"]AVST1[/COLOR]= 3D-AVSTÅND FRÅN PLAN PLAN1 TILL PLAN PLAN2,KORTASTE=AV,INGEN_RADIE ENHETER=MM,$ GRAF=AV TEXT=AV MULT=10.00 UTSKRIFT=INGEN AX MÄTT NOMINELLT +TOL -TOL AVV UTOMTOL M 3.968 4.000 0.500 -0.500 -0.032 0.000 #-
Then, create a generic circle that holds the nominal value and the measured value (the other THEO's are not interesting in this particular case):
F1 =ALLMÄN/CIRKEL,BEROENDE,REKTANGULÄRA,[COLOR="#FF8C00"]YTTRE[/COLOR],$ NOM/XYZ,<0,0,0>,$ MÄTT/XYZ,<0,0,0>,$ NOM/IJK,<0,0,1>,$ MÄTT/IJK,<0,0,1>,$ DIAMETER/[COLOR="#FF0000"]AVST1.NOM[/COLOR],[COLOR="#FF0000"]AVST1.MEAS[/COLOR]
The dark orange datafield decides whether to calculate the MMC as an axle (OUTER) or hole (INNER) to get the correct calculation.
Do a legacy TP for the circle, make sure you enable MMC for the feature and enter the correct tolerances and nominal for diameter feature - this will calculate correctly, without the need for you to create a CASE/IF/THEN/ELSE clause in order to not allow more MMC if the dimension is OOT on the plus side:
UTV [COLOR="#FF0000"]DIM1[/COLOR]= LÄGE FÖR CIRKEL F1 ENHETER=MM ,$ GRAF=AV TEXT=AV MULT=10.00 UTSKRIFT=INGEN PASSA REFERENSER=AV AVV VINKELRÄT MOT CENTRUMLINJE=AV VISNING=DIAMETER AX MÄTT NOMINELLT +TOL -TOL BONUS AVV UTOMTOL X 0.000 0.000 0.000 Y 0.000 0.000 0.000 Z 0.000 0.000 0.000 DF 3.968 [COLOR="#FF0000"]4.000 0.500 -0.500 [/COLOR]0.532 -0.032 0.000 #- TP MMC 0.000 0.532 0.000 0.000 #- **** PÅ UTVÄRDERING DIM1
Finally, assign the TP bonus to a variable for you to use in other calculations/evaluations:
TILLDELA/MMCTOL=[COLOR="#FF0000"]DIM1.TP.BTOL[/COLOR]
Done!