Hey, two new threads from me today. One on topic, one not so much.
I have a part to measure which has a very short 'slot' with a radius on each end. The slot has only one straight side (the other is open). I need to measure a line (vector of 1,0,0) along this straight side. I am trying to do the following:
Measure a circle at one end, re-measure the circle to ensure good hits.
Measure a circle at the other end, re-measure the circle to ensure good hits.
Pass the x values for the circle locations to a variable and subtract .02 from the difference between the x values. Then, I want to feed this variable into an autofeature line to control the length of my line. Doing this will allow my line to be as long as possible yet I can be sure the hits at the ends of the line won't fall on the radii.
I'm having trouble with my line's vector not coming out correctly. It seems that one time it will work and then the next it will be flipped and so the probe crashes into the radius at one end because it moves the wrong direction to try to take the second hit.
Here is the code:
See any problems with this?
EDIT: I forgot to mention that I think what might be screwing me up is that the x-locations of the circles are both negative.
I have a part to measure which has a very short 'slot' with a radius on each end. The slot has only one straight side (the other is open). I need to measure a line (vector of 1,0,0) along this straight side. I am trying to do the following:
Measure a circle at one end, re-measure the circle to ensure good hits.
Measure a circle at the other end, re-measure the circle to ensure good hits.
Pass the x values for the circle locations to a variable and subtract .02 from the difference between the x values. Then, I want to feed this variable into an autofeature line to control the length of my line. Doing this will allow my line to be as long as possible yet I can be sure the hits at the ends of the line won't fall on the radii.
I'm having trouble with my line's vector not coming out correctly. It seems that one time it will work and then the next it will be flipped and so the probe crashes into the radius at one end because it moves the wrong direction to try to take the second hit.
Here is the code:
Code:
CIR2 =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = YES THEO/-3.395,0.25,PLN3.Z,0,0,1,0.27 ACTL/-3.3978,0.2405,-0.3366,0,0,1,0.2666 TARG/-3.395,0.25,PLN3.Z,0,0,1 MEAS/CIRCLE HIT/BASIC,-3.3472,0.1154,-0.3866,-0.3746,0.9272,0,-3.3477,0.1168,-0.3862 HIT/BASIC,-3.3192,0.1308,-0.3866,-0.5821,0.8131,0,-3.3198,0.1324,-0.3863 HIT/BASIC,-3.2956,0.1524,-0.3866,-0.757,0.6534,0,-3.2967,0.1538,-0.3863 HIT/BASIC,-3.2777,0.1789,-0.3866,-0.8894,0.4571,0,-3.2791,0.1802,-0.3863 HIT/BASIC,-3.2666,0.2088,-0.3866,-0.972,0.2351,0,-3.2678,0.2096,-0.3863 HIT/BASIC,-3.2628,0.2406,-0.3866,-1,0,0,-3.2643,0.2402,-0.3864 HIT/BASIC,-3.2666,0.2723,-0.3866,-0.972,-0.2351,0,-3.2682,0.2713,-0.3864 HIT/BASIC,-3.2777,0.3023,-0.3866,-0.8894,-0.4571,0,-3.2786,0.3011,-0.3864 HIT/BASIC,-3.2956,0.3288,-0.3866,-0.757,-0.6534,0,-3.2967,0.3269,-0.3864 HIT/BASIC,-3.3192,0.3504,-0.3866,-0.5821,-0.8131,0,-3.3199,0.3485,-0.3864 HIT/BASIC,-3.3472,0.3658,-0.3866,-0.3746,-0.9272,0,-3.3477,0.3642,-0.3864 ENDMEAS/ CIR3 =AUTO/CIRCLE,SHOWALLPARAMS = NO,SHOWHITS = YES THEO/-3.545,0.25,PLN3.Z,0,0,1,0.27 ACTL/-3.5498,0.2401,-0.3366,0,0,1,0.2682 TARG/-3.545,0.25,PLN3.Z,0,0,1 MEAS/CIRCLE HIT/BASIC,-3.6017,0.3649,-0.3866,0.3746,-0.9272,0,-3.6019,0.3636,-0.3864 HIT/BASIC,-3.6297,0.3495,-0.3866,0.5821,-0.8131,0,-3.6296,0.348,-0.3863 HIT/BASIC,-3.6533,0.3279,-0.3866,0.757,-0.6534,0,-3.6526,0.3261,-0.3863 HIT/BASIC,-3.6712,0.3014,-0.3866,0.8894,-0.4571,0,-3.6696,0.2997,-0.3863 HIT/BASIC,-3.6824,0.2714,-0.3866,0.972,-0.2351,0,-3.6804,0.2702,-0.3862 HIT/BASIC,-3.6861,0.2397,-0.3866,1,0,0,-3.684,0.2399,-0.3862 HIT/BASIC,-3.6824,0.208,-0.3866,0.972,0.2351,0,-3.6803,0.209,-0.3862 HIT/BASIC,-3.6712,0.178,-0.3866,0.8894,0.4571,0,-3.6695,0.1797,-0.3862 HIT/BASIC,-3.6533,0.1515,-0.3866,0.757,0.6534,0,-3.6522,0.1536,-0.3862 HIT/BASIC,-3.6297,0.1299,-0.3866,0.5821,0.8131,0,-3.6292,0.1321,-0.3862 HIT/BASIC,-3.6017,0.1145,-0.3866,0.3746,0.9272,0,-3.6015,0.1165,-0.3862 ENDMEAS/ PREHIT/ 0.05 RETRACT/ 0.05 MOVE/POINT,NORMAL,-3.5346,0.2435,-0.3865 ASSIGN/V1 = ABS(CIR7.X-CIR8.X-.02) LIN5 =AUTO/LINE,SHOWALLPARAMS = NO,SHOWHITS = YES THEO/CIR8.X+.01,0.385,PLN3.Z-.050,-3.0005,0.385,-0.3866,V1 ACTL/4.1904,7.3463,-13.8028,4.322,7.347,-13.8026,0.1316351 TARG/-3.1305,0.385,-0.3866,-2.9989,0.385,-0.3866 MEAS/LINE HIT/BASIC,-3.1305,0.385,-0.3866,0,-1,0,-3.1305,0.385,-0.3866 HIT/BASIC,-3.0005,0.385,-0.3866,0,-1,0,-3.0005,0.385,-0.3866 ENDMEAS/
EDIT: I forgot to mention that I think what might be screwing me up is that the x-locations of the circles are both negative.
Comment