hexagon logo

[2023.2 SP3] Looping breaks evaluations using child ITEMS[]?

Program uses cylinders measured as concentric circles.
Roundness evaluation is done on the circles in the cylinders (child items).
This works fine when running one execution, but doesn't work when looping several iterations, instead they all share the exact same result:

The total runout is two separate planes so no issues there, but the circles from the two cylinders (CYLVÄ75 & CYLHÖ75) share the same roundness result per circle in the cylinder.

Opening the program after a looped run and no values:

Example of a single run (no looping):

Any ideas how to make the ITEMS[] work when looping? Are the ITEMS[] clashing with the loop counter [x]?

Parents Reply Children
  • No, it didn't help. It still presents the same result over all child items.

    Ping  

  • As it says in the help file, we do not fully support looping geometric tolerance commands.  I suspect you are trying to use the built-in LOOP, END/LOOP method which, as you are finding, has limitations.  I was able to get it to work using a DO/UNTIL block - see below...

    CODE...

                DO/
                  ASSIGN/V1=V1+1
    CYL1         =FEAT/CONTACT/CYLINDER/ADAPTIVE_CYLINDER_CONCENTRIC_CIRCLE_SCAN,CARTESIAN,IN,LEAST_SQR
                  THEO/<20.5*COS(DEG2RAD(90*V1)),20.5*SIN(DEG2RAD(90*V1)),0>,<0,0,1>,8.2,10
                  ACTL/<20.5,0,0>,<0,0,1>,8.2,10
                  TARG/<20.5*COS(DEG2RAD(90*V1)),20.5*SIN(DEG2RAD(90*V1)),0>,<0,0,1>
                  START ANG=0,END ANG=360
                  ANGLE VEC=<1,0,0>
                  DIRECTION=CCW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=YES
                    NUMHITS=220,NUMLEVELS=5,DEPTH=2,END OFFSET=2,PITCH=0
                    SAMPLE METHOD=SAMPLE_HITS
                    SAMPLE HITS=0,SPACER=0
                    AVOIDANCE MOVE=BOTH,DISTANCE BEFORE=10,DISTANCE AFTER=10,DIRECTION=ALONG FEATURE VECTOR
                    FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                  SHOW HITS=NO
    CIR0         =FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR,YES
                  THEO/<20.5*COS(DEG2RAD(90*V1)),20.5*SIN(DEG2RAD(90*V1)),-2>,<0,0,1>,8.2
                  ACTL/<20.5,0,-2>,<0,0,1>,8.2
                  CONSTR/CIRCLE,BFRE,2D,CYL1.ITEM[CIRCLE0].HIT[..],,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,UPR=0
    CIR1         =FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR,YES
                  THEO/<20.5*COS(DEG2RAD(90*V1)),20.5*SIN(DEG2RAD(90*V1)),-3.5>,<0,0,1>,8.2
                  ACTL/<20.5,0,-3.5>,<0,0,1>,8.2
                  CONSTR/CIRCLE,BFRE,2D,CYL1.ITEM[CIRCLE1].HIT[..],,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,UPR=0
    CIR2         =FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR,YES
                  THEO/<20.5*COS(DEG2RAD(90*V1)),20.5*SIN(DEG2RAD(90*V1)),-5>,<0,0,1>,8.2
                  ACTL/<20.5,0,-5>,<0,0,1>,8.2
                  CONSTR/CIRCLE,BFRE,2D,CYL1.ITEM[CIRCLE2].HIT[..],,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,UPR=0
    CIR3         =FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR,YES
                  THEO/<20.5*COS(DEG2RAD(90*V1)),20.5*SIN(DEG2RAD(90*V1)),-6.5>,<0,0,1>,8.2
                  ACTL/<20.5,0,-6.5>,<0,0,1>,8.2
                  CONSTR/CIRCLE,BFRE,2D,CYL1.ITEM[CIRCLE3].HIT[..],,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,UPR=0
    CIR4         =FEAT/CIRCLE,CARTESIAN,IN,LEAST_SQR,YES
                  THEO/<20.5*COS(DEG2RAD(90*V1)),20.5*SIN(DEG2RAD(90*V1)),-8>,<0,0,1>,8.2
                  ACTL/<20.5,0,-8>,<0,0,1>,8.2
                  CONSTR/CIRCLE,BFRE,2D,CYL1.ITEM[CIRCLE4].HIT[..],,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,UPR=0
    FCFCIRTY1    =GEOMETRIC_TOLERANCE/STANDARD=ISO 1101,SHOWEXPANDED=YES,
                  DESCRIPTION=ON,,
                  FEATURE_MATH=DEFAULT,
                  UNITS=MM,OUTPUT=BOTH,ARROWDENSITY=100,
                  SEGMENT_1,CIRCULARITY,0.01,TOL_ZONE_MATH=DEFAULT,
                  TEXT=OFF,CADGRAPH=OFF,REPORTGRAPH=OFF,MULT=10,
                    MEASURED:
                      CIR0[V1]:0.000,
                      CIR1[V1]:0.000,
                      CIR2[V1]:0.000,
                      CIR3[V1]:0.000,
                      CIR4[V1]:0.000,
                  FEATURES/CIR0[V1],CIR1[V1],CIR2[V1],CIR3[V1],CIR4[V1],,
                UNTIL/V1==4

  • Thanks  

    The program keeps crashing after a while, perhaps this could be a reason for the crashing? The crash reporter creates a 2GB report file, on a program with a small CAD and PRG is 15 MB...

    I have updated to 2023.2 SP4 now to see if that changes anything. If not, I'll try with DO/UNTIL.

  •  What's up with the "*COS(DEG2RAD(90*V1) then the SIN one within the THEO? I have never seen that before. Just curious as to the reason. Thanks in advance.

  • That's how I'm getting it to rotate by 90° for each hole..

    Avoids the problems associated with trying to rotate an alignment inside a loop (nominals updating etc.)

  • Never thought about doing that! Pretty slick. Slight smile

  • You guys have any plans in the future to update the help files to have more in depth tricks like these? This is an awesome trick.

    I also can't find anything in the help files about using the FEATURE.ITEM extension anywhere, and I do not see it in the expression builder. Do you happen to know if this documented anywhere? I could also not be looking in the correct Help files. I have not checked laser documentation.