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
  • good day,

    if you are interested in a script for min max, then i have something for you.

    Highlights are it is much faster than the pcDMIS loop
    and you have less pcDMIS code


    1) See attachement
    (File must be renamed to *.bas to work)


    2) ARG1 = non-numeric part of the feature name
    ARG2 = String-Name of the pcDMIS variable for MAX
    ARG3 = String-Name of the pcDMIS variable for MIN

    3) note that it only works with auto circles, but can be rewritten for other elements

    4) note that it doesn't work with pcDMIS loops, but i can add that as well if interested

    5) the two variables (Max and Min) must be assigned somewhere before the script is called
    (with a random value)
    (the script then overwrites the value of the variable)


    here is an example of how the script is used in pcDMIS:
    
    $$ NO,
    MOVE/CLEARPLANE
    
    LOC_1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
    THEO/<-2,42,17.5>,<1,0,0>,7
    ACTL/<-2,41.759,17.516>,<1,0,0>,7.019
    TARG/<-2,42,17.5>,<1,0,0>
    START ANG=0,END ANG=360
    ANGLE VEC=<0,0,-1>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    
    MOVE/CLEARPLANE
    
    LOC_2 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
    THEO/<-2,42,-17.5>,<1,0,0>,7
    ACTL/<-2,41.769,-17.487>,<1,0,0>,7.013
    TARG/<-2,42,-17.5>,<1,0,0>
    START ANG=0,END ANG=360
    ANGLE VEC=<0,0,-1>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    
    MOVE/CLEARPLANE
    
    LOC_3 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
    THEO/<-2,92,17.5>,<1,0,0>,7
    ACTL/<-2,91.772,17.516>,<1,0,0>,7.008
    TARG/<-2,92,17.5>,<1,0,0>
    START ANG=0,END ANG=360
    ANGLE VEC=<0,0,-1>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    
    MOVE/CLEARPLANE
    
    LOC_4 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
    THEO/<-2,92,-17.5>,<1,0,0>,7
    ACTL/<-2,91.77,-17.479>,<1,0,0>,7.013
    TARG/<-2,92,-17.5>,<1,0,0>
    START ANG=0,END ANG=360
    ANGLE VEC=<0,0,-1>
    DIRECTION=CCW
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    
    MOVE/CLEARPLANE
    
    ASSIGN/VARMAX=0
    ASSIGN/VARMIN=0
    
    CS1 =SCRIPT/FILENAME= C:\USERS\QS\DESKTOP\DMISMAXMIN.BAS
    FUNCTION/Main,SHOW=NO,ARG1="LOC",ARG2="VARMAX",ARG3="VARMIN",,
    STARTSCRIPT/
    
    DMAX =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
    NOM/XYZ,<0,0,0>,$
    MEAS/XYZ,<0,0,0>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>,$
    DIAMETER/LOC_1.TD,VARMAX
    
    DMIN =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
    NOM/XYZ,<0,0,0>,$
    MEAS/XYZ,<0,0,0>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>,$
    DIAMETER/LOC_1.TD,VARMIN
    
    DIM LAGE1= LOCATION OF CIRCLE DMAX UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL MEAS +TOL -TOL DEV OUTTOL
    D 7.000 7.019 0.100 -0.100 0.019 0.000
    END OF DIMENSION LAGE1
    
    DIM LAGE2= LOCATION OF CIRCLE DMIN UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL MEAS +TOL -TOL DEV OUTTOL
    D 7.000 7.008 0.100 -0.100 0.008 0.000
    END OF DIMENSION LAGE2
    
    
  • This was something new Slight smile
    Thanks for sharing, will try it...
Reply Children
No Data