Help with "while loop"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with "while loop"

    2019R2...

    Instead of writing this program to measure one position and copy & paste with pattern and make a bunch of alignments (like I usually do)...I would like to try and "while loop" this.

    Loop is failing.. I'm close but no cigar..am hoping someone can tell me what I am doing wrong.

    Want this to execute 6 times.
    Loop 1/6 will execute fine..it will then go to loop 2/6 everything looks good (will take good looking points for rim, cone, plane) until it gets to A8 and then it will go and probe points in the same position as loop1 for the radii. Once it measures the radii in the wrong spot it then goes and executes 3/6 and that will look good/correct until it gets to A8 again.

    "treat theo vales as if stored in part coordinates" box checked off.

    Thanks in advance.

    Capture.PNG


    Code:
    A7         =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                  ALIGNMENT/LEVEL,ZMINUS,CYL_B
                  ALIGNMENT/ROTATE,XPLUS,TO,LINXY2,ABOUT,ZMINUS
                  ALIGNMENT/TRANS,XAXIS,CYL_B
                  ALIGNMENT/TRANS,YAXIS,CYL_B
                  ALIGNMENT/TRANS,ZAXIS,PNT_REAL
                ALIGNMENT/END
                MOVE/INCREMENT,<1.5,0,0>
                ASSIGN/ANG=0
                WHILE/ANG<=300
    A9           =ALIGNMENT/START,RECALL:A7,LIST=YES
                    ALIGNMENT/ROTATE_OFFSET,ANG,ABOUT,ZPLUS
                  ALIGNMENT/END
                  WORKPLANE/ZPLUS
    PNT_RIM_1    =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<4,0,-2.7193>,<0,0,1>
                  ACTL/<4,0,-2.7193>,<0,0,1>
                  TARG/<4,0,-2.7193>,<0,0,1>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    PNT_RIM_2    =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<3.96,0,-2.7193>,<0,0,1>
                  ACTL/<3.96,0,-2.7193>,<0,0,1>
                  TARG/<3.96,0,-2.7193>,<0,0,1>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    PNT_RIM_3    =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<3.9,0,-2.7193>,<0,0,1>
                  ACTL/<3.9,0,-2.7193>,<0,0,1>
                  TARG/<3.9,0,-2.7193>,<0,0,1>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    PNT_CON_1    =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<3.8752,0,-2.7517>,<-0.9659258,0,0.258819>
                  ACTL/<3.8752,0,-2.7517>,<-0.9659258,0,0.258819>
                  TARG/<3.8752,0,-2.7517>,<-0.9659258,0,0.258819>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    PNT_CON_2    =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<3.8548,0,-2.8278>,<-0.9659258,0,0.258819>
                  ACTL/<3.8548,0,-2.8278>,<-0.9659258,0,0.258819>
                  TARG/<3.8548,0,-2.8278>,<-0.9659258,0,0.258819>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    PNT_CON_3    =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<3.8323,0,-2.9118>,<-0.9659258,0,0.258819>
                  ACTL/<3.8323,0,-2.9118>,<-0.9659258,0,0.258819>
                  TARG/<3.8323,0,-2.9118>,<-0.9659258,0,0.258819>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    PNT_PLN1_1   =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<3.55,0,-3.1169>,<0,0,1>
                  ACTL/<3.55,0,-3.1169>,<0,0,1>
                  TARG/<3.55,0,-3.1169>,<0,0,1>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    PNT_PLN1_2   =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<2.96,0,-3.1169>,<0,0,1>
                  ACTL/<2.96,0,-3.1169>,<0,0,1>
                  TARG/<2.96,0,-3.1169>,<0,0,1>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    PNT_PLN1_3   =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<2.42,0,-3.1169>,<0,0,1>
                  ACTL/<2.42,0,-3.1169>,<0,0,1>
                  TARG/<2.42,0,-3.1169>,<0,0,1>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  WORKPLANE/YMINUS
    CIR3         =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,FIXED_RAD
                  THEO/<2.3612,0,-2.1326>,<0,-1,0>,1.9685
                  ACTL/<2.3612,0,-2.1326>,<0,-1,0>,1.9685
                  TARG/<2.3612,0,-2.1326>,<0,-1,0>
                  START ANG=270,END ANG=258.5202
                  ANGLE VEC=<1,0,0>
                  DIRECTION=CW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    A8           =ALIGNMENT/START,RECALL:A9,LIST=YES
                    ALIGNMENT/TRANS,XAXIS,CIR3
                    ALIGNMENT/TRANS,ZAXIS,CIR3
                  ALIGNMENT/END
    RAD_138_2    =FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                  THEO/<0,0,0>,<0,-1,0>,1.9685
                  ACTL/<0,0,0>,<0,-1,0>,1.9685
                  TARG/<0,0,0>,<0,-1,0>
                  START ANG=270,END ANG=258.5202
                  ANGLE VEC=<1,0,0>
                  DIRECTION=CW
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  WORKPLANE/ZPLUS
                  RECALL/ALIGNMENT,INTERNAL,A9
    PNT_PLN2_1   =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<2.1265,0,-3.0972>,<0,0,1>
                  ACTL/<2.1265,0,-3.0972>,<0,0,1>
                  TARG/<2.1265,0,-3.0972>,<0,0,1>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    PNT_PLN2_2   =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<2,0,-3.0972>,<0,0,1>
                  ACTL/<2,0,-3.0972>,<0,0,1>
                  TARG/<2,0,-3.0972>,<0,0,1>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    PNT_PLN2_3   =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<1.9,0,-3.0972>,<0,0,1>
                  ACTL/<1.9,0,-3.0972>,<0,0,1>
                  TARG/<1.9,0,-3.0972>,<0,0,1>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
    LIN2         =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                  THEO/<1.9,0,-3.0972>,<1,0,0>
                  ACTL/<1.9,0,-3.0972>,<1,0,0>
                  CONSTR/LINE,BF,2D,PNT_PLN2_3,PNT_PLN2_2,PNT_PLN2_1,,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,WAVELENGTH=0
                  WORKPLANE/YMINUS
    PNT_153      =FEAT/POINT,CARTESIAN,NO
                  THEO/<2.1654,0,-3.0972>,<1,0,0>
                  ACTL/<2.1654,0,-3.0972>,<1,0,0>
                  CONSTR/POINT,PIERCE,LIN2,RAD_138_2
                  WORKPLANE/ZPLUS
                  ASSIGN/ANG=ANG+60
                END_WHILE/
    Last edited by DAN_M; 12-30-2019, 10:34 AM.
    SF7107(PCD), SF454(PCD), 152614(Quindos), 9159(Quindos), 7107(Quindos), B&S Manual, M&M Gear Checker

  • #2
    Its CIR_3, there is nothing in here allowing the alignment to change for the CIR_3[1]-[7] that is generated..

    Not sure what the 'right' work around is, but could be use of a counter feature and have your CIR_3 feature become "CIR_3_"+ANG
    Then each circle is unique itself and called out right for the alignment?

    HTH

    Comment


    • #3
      would a polar co-ord. system loop easier?

      Comment


      • #4
        I think I would recall LINXY2 in A9, and offset it, and I would also change the vector angle of cir_3 from 1,0,0 to 0,0,1.
        Not sure that helps...

        Comment


        • #5
          Also, I would recall A7 just before End While.

          Comment

          Related Topics

          Collapse

          Working...
          X