Matthew D. Hoedeman
03-03-2006, 09:53 AM
Here is some code I have for measuring different sizes of a "tooling ball holding key", you enter the width of the key, it does the rest. You would need to put the variables in different places and different features, but it should help you get the idea:
C1 =COMMENT/INPUT,What size key, please, in METRIC
ASSIGN/V1 = C1.INPUT
ASSIGN/V2 = V1/2
ASSIGN/V3 = V2+3
AA1 =AUTO/VECTOR POINT, SHOWALLPARAMS=YES
THEO/0,0-V3,-15.7,1,0,0
ACTL/0,-8,-15.7,1,0,0
TARG/0,0-V3,-15.7,1,0,0
THEO_THICKNESS = 0, RECT, SNAP = YES ,$
AUTO MOVE = NO, DISTANCE = 5
KEY01 =AUTO/VECTOR POINT, SHOWALLPARAMS=YES
THEO/2.5,0-V2,-15.7,0,-1,0
ACTL/2.5,-5,-15.7,0,-1,0
TARG/2.5,0-V2,-15.7,0,-1,0
THEO_THICKNESS = 0, RECT, SNAP = YES ,$
AUTO MOVE = NO, DISTANCE = 5
I have heard that if you don't include the math operation in some versions it will give you incorrect nominals.
CORKSCREW
01-17-2008, 10:21 PM
Here's a code I wrote to check your rings. (it will work with pins also with the ID switched to OD) It assumes you have CAD++. (I'm sure you can make something similar work if you don't have auto features) It also assumes the ring will be relatively close to the same x,y and z each time you put a new ring down. (I'd do a manual on the 1st ring, then just put all the rest close to the same place, the initial prehit is very large to accomodate for different ring thicknesses and not placing it on zero. The program will automatically find then level the part regardless of dia., then enter the correct tolerance according to class. I only used x, y and z tolerances and only went to rings up to 2.51 dia, but you should be able to fill in the rest now that you have an example and by using the same code logic. You can also add more levels or use math functions to convert english to metric
PREHIT/ 0.5
RETRACT/ 0.5
MODE/DCC
C1 =COMMENT/INPUT,Enter diameter
ASSIGN/DIA = C1.INPUT
ASSIGN/RAD = C1.INPUT/2
RING_LOC =AUTO/CIRCLE, SHOWALLPARAMS=YES, SHOWHITS=NO
THEO/0,0,0,0,0,1,DIA
ACTL/0,0,0,0,0,1,2.5
TARG/0,0,0,0,0,1
THEO_THICKNESS = 0, RECT, IN, CIRCULAR, LEAST_SQR, ONERROR =
AUTO MOVE = NO, DISTANCE = 1, RMEAS = None, READ POS = NO, FIND HOLE = NO, REMEASURE = NO ,$
NUMHITS = 3, INIT = 0, PERM = 0, SPACER = 0, PITCH = 0 ,$
START ANG = 0, END ANG = 360, DEPTH = 0.25 ,$
ANGLE VEC = 1,0,0
A2 =ALIGNMENT/START,RECALL:A1, LIST= YES
ALIGNMENT/TRANS,XAXIS,RING_LOC
ALIGNMENT/TRANS,YAXIS,RING_LOC
ALIGNMENT/END
PNT1 =AUTO/VECTOR POINT, SHOWALLPARAMS=YES
THEO/RAD+.05,0,0,0,0,1
ACTL/1.3,0,0,0,0,1
TARG/RAD+.05,0,0,0,0,1
THEO_THICKNESS = 0, RECT, SNAP = YES ,$
AUTO MOVE = NO, DISTANCE = 1
PNT2 =AUTO/VECTOR POINT, SHOWALLPARAMS=YES
THEO/-RAD-.05,0,0,0,0,1
ACTL/-1.3,0,0,0,0,1
TARG/-RAD-.05,0,0,0,0,1
THEO_THICKNESS = 0, RECT, SNAP = YES ,$
AUTO MOVE = NO, DISTANCE = 1
PNT3 =AUTO/VECTOR POINT, SHOWALLPARAMS=YES
THEO/0,RAD+.05,0,0,0,1
ACTL/0,1.3,0,0,0,1
TARG/0,RAD+.05,0,0,0,1
THEO_THICKNESS = 0, RECT, SNAP = YES ,$
AUTO MOVE = NO, DISTANCE = 1
PLN2 =FEAT/PLANE,RECT
THEO/0.03333,0.18333,0,0,0,1
ACTL/0,0.43333,0,0,0,1
CONSTR/PLANE,BF,PNT1,PNT2,PNT3,,
A3 =ALIGNMENT/START,RECALL:A2, LIST= YES
ALIGNMENT/LEVEL,ZPLUS,PLN2
ALIGNMENT/TRANS,ZAXIS,PLN2
ALIGNMENT/END
C2 =COMMENT/INPUT,Enter Tolerance
,1=X
,2=Y
,3=Z
IF/C1.INPUT<=.825
GOTO/SIZE1
END_IF/
IF/C1.INPUT<=1.51
GOTO/SIZE2
END_IF/
IF/C1.INPUT<=2.51
GOTO/SIZE3
END_IF/
SIZE1 =LABEL/
IF/C2.INPUT==1
ASSIGN/T = .00004
END_IF/
IF/C2.INPUT==2
ASSIGN/T = .00007
END_IF/
IF/C2.INPUT==3
ASSIGN/T = .0001
END_IF/
GOTO/SIZEFINAL
SIZE2 =LABEL/
IF/C2.INPUT==1
ASSIGN/T = .00006
END_IF/
IF/C2.INPUT==2
ASSIGN/T = .00009
END_IF/
IF/C2.INPUT==3
ASSIGN/T = .00012
END_IF/
GOTO/SIZEFINAL
SIZE3 =LABEL/
IF/C2.INPUT==1
ASSIGN/T = .00008
END_IF/
IF/C2.INPUT==2
ASSIGN/T = .00012
END_IF/
IF/C2.INPUT==3
ASSIGN/T = .00016
END_IF/
GOTO/SIZEFINAL
SIZEFINAL =LABEL/
PREHIT/ 0.05
RETRACT/ 0.05
RING =AUTO/CIRCLE, SHOWALLPARAMS=YES, SHOWHITS=NO
THEO/0,0,0,0,0,1,DIA
ACTL/0,0,0,0,0,1,2.5
TARG/0,0,0,0,0,1
THEO_THICKNESS = 0, RECT, IN, CIRCULAR, LEAST_SQR, ONERROR = NO ,$
AUTO MOVE = NO, DISTANCE = 1, RMEAS = None, READ POS = NO, FIND HOLE = NO, REMEASURE = NO ,$
NUMHITS = 25, INIT = 0, PERM = 0, SPACER = 0, PITCH = 0 ,$
START ANG = 0, END ANG = 360, DEPTH = 0.25 ,$
ANGLE VEC = 1,0,0
DIM LOC1= LOCATION OF CIRCLE RING UNITS=IN ,$
GRAPH=OFF TEXT=OFF MULT=1.00 OUTPUT=BOTH
AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
D 2.50000 DIA T T 0.00000 0.00000 -#--
END OF DIMENSION LOC1
Good luck, hope it helps, let me know if you need further help. Some people post more questions to your questions than answers. It never ceases to amaze me how smart they want us to think they are and how unable others are when all most people need is a place to start and an example. I'm sure you can figure more out from this such as depths etc. If not, post again and maybe some will add something besides a question. If not, I will.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.