Is there a way to increment variable names using a counting variable in a do until loop. Going to try and explain what I want to do. I have 7 parts as they get bigger the number of holes increase. I am wanting to use a text file to create a parametric program. I can do this easily but I need to be able to get to the xyz of each hole after the loop exits. I have a position requirement that requires all holes position to be checked as a set. I would like to read each line from the text file into different variables for example cir1x cir1y cir1d ect. So I can then create auto feature. I can easily do this to report xy and d of each hole as it reads through the file using this code.
I can also do what i need for each line but just creating read lines for each one with different variable names. Each part has a different amount of holes ranging from 58 holes all the way up to 82. Is it possible to increment with each iteration of the loop the variable name?
Code:
FPTR =FILE/OPEN,Z:\parametricdata\test.txt,READ DO/ V4 =FILE/READLINE,FPTR,{CIR1X}+","+{CIR1Y}+","+{CIR1Z}+","+{CIR1D} CIR1 =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR THEO/<CIR1X,CIR1Y,CIR1Z>,<0,0,1>,CIR1D ACTL/<1.5,1.5,0>,<0,0,1>,0.125 TARG/<CIR1X,CIR1Y,CIR1Z>,<0,0,1> START ANG=0,END ANG=360 ANGLE VEC=<1,0,0> DIRECTION=CCW SHOW FEATURE PARAMETERS=NO SHOW CONTACT PARAMETERS=NO DIM LOC1= LOCATION OF CIRCLE CIR1 UNITS=IN ,$ GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO AX MEAS NOMINAL +TOL -TOL OUTTOL DEV X 1.5000 CIR1X 0.0020 0.0020 0.0000 0.0000 ----#---- Y 1.5000 CIR1Y 0.0020 0.0020 0.0000 0.0000 ----#---- D 0.1250 CIR1D 0.0020 0.0020 0.0000 0.0000 ----#---- END OF DIMENSION LOC1 UNTIL/V4=="EOF" FILE/CLOSE,FPTR,KEEP
Comment