hexagon logo

Find max, min dia for 'N' numbers of holes

we are using following code to find max and min dia among 93 holes inspected
can someone suggest any alternate way?
ASSIGN/COUNT=0
ASSIGN/NUM_OF_DIM=93
ASSIGN/MMPROF1=0
ASSIGN/MMPROF2=0
ASSIGN/MAX_DIM=0
ASSIGN/MIN_DIM=0
ASSIGN/MAX_PROF=0
ASSIGN/MIN_PROF=0
DO/
ASSIGN/COUNT=COUNT+1
ASSIGN/ID="LOC"+COUNT
ASSIGN/MMPROF1[COUNT]=ID.D.MEAS
ASSIGN/MMPROF2[COUNT]=MMPROF1[COUNT]
UNTIL/COUNT==NUM_OF_DIM
ASSIGN/MAX_DIM=MAXINDEX(MMPROF2)
ASSIGN/MIN_DIM=MININDEX(MMPROF2)
ASSIGN/MAX_PROF=MMPROF2[MAX_DIM]
ASSIGN/MIN_PROF=MMPROF2[MIN_DIM]
F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
NOM/XYZ,<1,0,0>,$
MEAS/XYZ,<MAX_PROF,0,0>,$
NOM/IJK,<0,0,1>,$
MEAS/IJK,<0,0,1>
DIM LOC94= LOCATION OF POINT F1 UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 1.0000 0.0200 0.0200 1.0000 0.0000 0.0000 --#--
END OF DIMENSION LOC94
F2 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
NOM/XYZ,<1,0,0>,$
MEAS/XYZ,<MIN_PROF,0,0>,$
NOM/IJK,<0,0,1>,$
MEAS/IJK,<0,0,1>
DIM LOC95= LOCATION OF POINT F2 UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
X 1.0000 0.0200 0.0200 1.0000 0.0000 0.0000 --#--
END OF DIMENSION LOC95
Parents
  • I don't use a lot of scripts, even if it looks nice ! ( : maybe I'm not really a robot ?)
    I believe you can simplify the code without crating generic points (or circles !), just using existing circles...
    V1 =LOOP/START,ID=YES,NUMBER=93,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/V2="CIR"+V1
    ASSIGN/V3[V1]=V2.D
    LOOP/END
    ASSIGN/V4="CIR"+MAXINDEX(V3)
    ASSIGN/V5="CIR"+MININDEX(V3)
    DIM LOC94= LOCATION OF CIRCLE V4 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
    D 1.0000 0.0200 0.0200 1.0000 0.0000 0.0000 --#--
    END OF DIMENSION LOC94
    DIM LOC95= LOCATION OF CIRCLE V5 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
    D 1.0000 0.0200 0.0200 1.0000 0.0000 0.0000 --#--
    END OF DIMENSION LOC94
Reply
  • I don't use a lot of scripts, even if it looks nice ! ( : maybe I'm not really a robot ?)
    I believe you can simplify the code without crating generic points (or circles !), just using existing circles...
    V1 =LOOP/START,ID=YES,NUMBER=93,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/V2="CIR"+V1
    ASSIGN/V3[V1]=V2.D
    LOOP/END
    ASSIGN/V4="CIR"+MAXINDEX(V3)
    ASSIGN/V5="CIR"+MININDEX(V3)
    DIM LOC94= LOCATION OF CIRCLE V4 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
    D 1.0000 0.0200 0.0200 1.0000 0.0000 0.0000 --#--
    END OF DIMENSION LOC94
    DIM LOC95= LOCATION OF CIRCLE V5 UNITS=IN ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
    D 1.0000 0.0200 0.0200 1.0000 0.0000 0.0000 --#--
    END OF DIMENSION LOC94
Children
No Data