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,

    i updated the script for pcDMIS loops aswell:

    Notes:
    File must be renamed to *.bas to work


    here is an example of how the script is used if a loop is present in pcDMIS:
    [...]
    
    V1 =LOOP/START,ID=YES,NUMBER=3,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=45
    
        ZYL1 =FEAT/CONTACT/CYLINDER/DEFAULT,CARTESIAN,IN,LEAST_SQR
        THEO/<-354.3,0.5,0>,<-1,0,0>,33,186.96
        ACTL/<-354.3,0.5,0>,<-1,0,0>,33,186.96
        TARG/<-354.3,0.5,0>,<-1,0,0>
        START ANG=0,END ANG=360
        ANGLE VEC=<0,0,1>
        DIRECTION=CCW
        SHOW FEATURE PARAMETERS=NO
        SHOW CONTACT PARAMETERS=NO
    
    LOOP/END
    
    ASSIGN/VMAX=0
    ASSIGN/VMIN=0
    
    CS1 =SCRIPT/FILENAME= C:\USERS\QS\DESKTOP\DMISMAXMIN.BAS
    FUNCTION/Main,SHOW=YES,ARG1="ZYL",ARG2="VMAX",ARG3="VMIN",,
    STARTSCRIPT/
    ENDSCRIPT/
    
    DMAX =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,IN,$
    NOM/XYZ,<0,0,0>,$
    MEAS/XYZ,<0,0,0>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>,$
    DIAMETER/ZYL1.TD,VMAX
    
    DMIN =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,IN,$
    NOM/XYZ,<0,0,0>,$
    MEAS/XYZ,<0,0,0>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>,$
    DIAMETER/ZYL1.TD,VMIN
    
    DIM LOC1= LOCATION OF CIRCLE DMAX UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=100.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
    X 0.000 0.010 -0.010 0.000 0.000 0.000 ----#----
    Y 0.000 0.010 -0.010 0.000 0.000 0.000 ----#----
    D 33.000 0.010 -0.010 33.000 0.000 0.000 ----#----
    END OF DIMENSION LOC1
    
    DIM LOC2= LOCATION OF CIRCLE DMIN UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=100.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
    X 0.000 0.010 -0.010 0.000 0.000 0.000 ----#----
    Y 0.000 0.010 -0.010 0.000 0.000 0.000 ----#----
    D 33.000 0.010 -0.010 33.000 0.000 0.000 ----#----
    END OF DIMENSION LOC2
    
    [...]
    
Reply
  • good day,

    i updated the script for pcDMIS loops aswell:

    Notes:
    File must be renamed to *.bas to work


    here is an example of how the script is used if a loop is present in pcDMIS:
    [...]
    
    V1 =LOOP/START,ID=YES,NUMBER=3,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=45
    
        ZYL1 =FEAT/CONTACT/CYLINDER/DEFAULT,CARTESIAN,IN,LEAST_SQR
        THEO/<-354.3,0.5,0>,<-1,0,0>,33,186.96
        ACTL/<-354.3,0.5,0>,<-1,0,0>,33,186.96
        TARG/<-354.3,0.5,0>,<-1,0,0>
        START ANG=0,END ANG=360
        ANGLE VEC=<0,0,1>
        DIRECTION=CCW
        SHOW FEATURE PARAMETERS=NO
        SHOW CONTACT PARAMETERS=NO
    
    LOOP/END
    
    ASSIGN/VMAX=0
    ASSIGN/VMIN=0
    
    CS1 =SCRIPT/FILENAME= C:\USERS\QS\DESKTOP\DMISMAXMIN.BAS
    FUNCTION/Main,SHOW=YES,ARG1="ZYL",ARG2="VMAX",ARG3="VMIN",,
    STARTSCRIPT/
    ENDSCRIPT/
    
    DMAX =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,IN,$
    NOM/XYZ,<0,0,0>,$
    MEAS/XYZ,<0,0,0>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>,$
    DIAMETER/ZYL1.TD,VMAX
    
    DMIN =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,IN,$
    NOM/XYZ,<0,0,0>,$
    MEAS/XYZ,<0,0,0>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>,$
    DIAMETER/ZYL1.TD,VMIN
    
    DIM LOC1= LOCATION OF CIRCLE DMAX UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=100.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
    X 0.000 0.010 -0.010 0.000 0.000 0.000 ----#----
    Y 0.000 0.010 -0.010 0.000 0.000 0.000 ----#----
    D 33.000 0.010 -0.010 33.000 0.000 0.000 ----#----
    END OF DIMENSION LOC1
    
    DIM LOC2= LOCATION OF CIRCLE DMIN UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=100.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
    X 0.000 0.010 -0.010 0.000 0.000 0.000 ----#----
    Y 0.000 0.010 -0.010 0.000 0.000 0.000 ----#----
    D 33.000 0.010 -0.010 33.000 0.000 0.000 ----#----
    END OF DIMENSION LOC2
    
    [...]
    
Children
No Data