Need help with do loop with a count

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

  • Need help with do loop with a count

    So i have 196 features to program, they will all require the same 7 points, I have a variable I am going to use for each axis, the vectors will be the same. I have seen a program before where it ran through and said on loop 1 use this variable count list 1, on loop 2 use variable count list 2, and so on. then I can program the loop using all the same variables because it will pull them from a count.

    I know i will need to put the variables in order from block / COUNT 1, slot 1-variables, COUNT 2, slot 2 varibales. But I cant figure out when using the DO LOOP, how do i say which block of variables to use in which loop number.







    $$ NO,
    -----------------------------------------------------------------------------------------

    ASSIGN/SLOT_D=0.0170
    ASSIGN/SLOT=SLOT_D/2
    $$ NO,
    -----------------------------------------------------------------------------------------

    ASSIGN/SLOT_1=0.1550
    ASSIGN/SLOT_2=0.1551
    ASSIGN/SLOT_3=0.1551
    $$ NO,
    -----------------------------------------------------------------------------------------

    ASSIGN/Y1=0.0009
    ASSIGN/Y2=-0.0010
    ASSIGN/Y3=0.0010
    $$ NO,
    -----------------------------------------------------------------------------------------

    ASSIGN/XOFF=-0.2005
    ASSIGN/X1=19.5488
    ASSIGN/X2=X1-XOFF
    ASSIGN/X3=X2-XOFF
    $$ NO,
    -----------------------------------------------------------------------------------------

    ASSIGN/SLOT_Z=-0.0050
    $$ NO,
    -----------------------------------------------------------------------------------------
    $$ NO,
    -----------------------------------------------------------------------------------------

    PNT_01 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1,-0.14015,0.132999>,<0,1,0>
    ACTL/<-19.5488,-0.14015,0.132999>,<0,1,0>
    TARG/<-X1,-0.14015,0.132999>,<0,1,0>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_02 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1,0.14015,0.13994>,<0,-1,0>
    ACTL/<-19.5488,0.14015,0.13994>,<0,-1,0>
    TARG/<-19.5488,0.14015,0.13994>,<0,-1,0>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_03 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1,0.022,ZERO>,<ZERO,ZERO,ONE>
    ACTL/<-19.5488,0.022,0>,<0,0,1>
    TARG/<-X1,0.022,ZERO>,<ZERO,ZERO,ONE>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_04 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1,Y1-SLOT,SLOT_Z>,<ZERO,ONE,ZERO>
    ACTL/<-19.5488,-0.0076,-0.005>,<0,1,0>
    TARG/<-X1,Y1-SLOT,SLOT_Z>,<ZERO,ONE,ZERO>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_05 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1,Y1+SLOT,SLOT_Z>,<ZERO,-ONE,ZERO>
    ACTL/<-19.5488,0.0094,-0.005>,<0,-1,0>
    TARG/<-X1,Y1+SLOT,SLOT_Z>,<ZERO,-ONE,ZERO>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_06 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1-SLOT_1/2,Y1,SLOT_Z>,<ONE,ZERO,ZERO>
    ACTL/<-19.6263,0.0009,-0.005>,<1,0,0>
    TARG/<-X1-SLOT_1/2,Y1,SLOT_Z>,<ONE,ZERO,ZERO>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_07 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1+SLOT_1/2,Y1,SLOT_Z>,<-ONE,ZERO,ZERO>
    ACTL/<-19.4713,0.0009,-0.005>,<-1,0,0>
    TARG/<-X1+SLOT_1/2,Y1,SLOT_Z>,<-ONE,ZERO,ZERO>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    $$ NO,
    -----------------------------------------------------------------------------------------

    Untitled.jpgslots.jpg
    Attached Files
    Last edited by rtlawlor; 08-18-2020, 07:42 PM.
    -riley Lawlor
    Southern California
    Aerospace CNC Machinery

  • #2
    I tried doing this as a test for the first 3 of 196, but it isn't working correct.


    $$ NO,
    -----------------------------------------------------------------------------------------

    $$ NO,
    -----------------------------------------------------------------------------------------

    ASSIGN/SLOT_D=0.0170
    ASSIGN/SLOT=SLOT_D/2
    ASSIGN/SLOT_Z=-0.0050
    ASSIGN/COUNTER=0
    ASSIGN/X1=19.5488
    ASSIGN/XOFF=0.2005
    DO/
    ASSIGN/COUNTER=COUNTER+1
    IF/COUNTER==1
    ASSIGN/SLOT_1=0.1550
    ASSIGN/X1=19.5488
    ASSIGN/Y1=0.0009
    END_IF/
    IF/COUNTER==2
    ASSIGN/SLOT_1=0.1551
    ASSIGN/X1=X1-XOFF
    ASSIGN/Y1=-0.0010
    END_IF/
    IF/COUNTER==3
    ASSIGN/SLOT_1=0.1551
    ASSIGN/X1=X1-XOFF
    ASSIGN/Y1=0.0010
    END_IF/
    $$ NO,
    -----------------------------------------------------------------------------------------

    $$ NO,
    -----------------------------------------------------------------------------------------

    $$ NO,
    -----------------------------------------------------------------------------------------

    $$ NO,
    -----------------------------------------------------------------------------------------

    PNT_01 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1,-0.14015*1,0.1400*1>,<ZERO,ONE,ZERO>
    ACTL/<-19.3483,-0.14015,0.14>,<0,1,0>
    TARG/<-X1,-0.14015,0.1400*1>,<ZERO,ONE,ZERO>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_02 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1,0.14015*1,0.1400*1>,<ZERO,-ONE,ZERO>
    ACTL/<-19.3483,0.14015,0.14>,<0,-1,0>
    TARG/<-X1,0.14015*1,0.1400*1>,<ZERO,-ONE,ZERO>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO

    SHOW CONTACT PARAMETERS=NO
    PNT_03 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1,0.022,ZERO>,<ZERO,ZERO,ONE>
    ACTL/<-19.3483,0.022,0>,<0,0,1>
    TARG/<-X1,0.022,ZERO>,<ZERO,ZERO,ONE>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_04 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1,Y1-SLOT,SLOT_Z>,<ZERO,ONE,ZERO>
    ACTL/<-19.3483,-0.0075,-0.005>,<0,1,0>
    TARG/<-X1,Y1-SLOT,SLOT_Z>,<ZERO,ONE,ZERO>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_05 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1,Y1+SLOT,SLOT_Z>,<ZERO,-ONE,ZERO>
    ACTL/<-19.3483,0.0095,-0.005>,<0,-1,0>
    TARG/<-X1,Y1+SLOT,SLOT_Z>,<ZERO,-ONE,ZERO>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_06 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1-SLOT_1/2,Y1,SLOT_Z>,<ONE,ZERO,ZERO>
    ACTL/<-19.42585,0.001,-0.005>,<1,0,0>
    TARG/<-X1-SLOT_1/2,Y1,SLOT_Z>,<ONE,ZERO,ZERO>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO

    PNT_07 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<-X1+SLOT_1/2,Y1,SLOT_Z>,<-ONE,ZERO,ZERO>
    ACTL/<-19.27075,0.001,-0.005>,<-1,0,0>
    TARG/<-X1+SLOT_1/2,Y1,SLOT_Z>,<-ONE,ZERO,ZERO>
    SNAP=NO
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    $$ NO,
    -----------------------------------------------------------------------------------------

    ASSIGN/COUNTER=COUNTER+1
    UNTIL/COUNTER>=3
    $$ NO,
    -----------------------------------------------------------------------------------------

    $$ NO,
    -----------------------------------------------------------------------------------------

    ROUTINE/END
    $$ NO,
    -riley Lawlor
    Southern California
    Aerospace CNC Machinery

    Comment


    • #3
      First, as you use only SLOT_1/2, I would assign SLOT_1 = (different values)/2 directly.
      I don't see ASSIGN/ZERO and ONE.
      You write twice ASSIGN/COUNT=COUNT+1 in the loop, at the start and at the end, so you start COUNT=1, then COUNT=3 and never count = 2...
      Last edited by JEFMAN; 08-19-2020, 08:27 AM.

      Comment


      • #4
        The attached pictures don't match each other or is it just me? One is zig-zagging and the other is slots in-line. I'll pick the ziggy-zag for my example... give me a minute and I'll pump something out.
        PcDmis 2015.1 SP10 CAD++
        Global 7-10-7 DC800S

        Comment


        • #5
          I would create a simple loop from 1 to 196...
          Not sure answering to all your questions of both posts..., hope this helps.

          Code:
          ASSIGN/SLOT_D=0.0170
          ASSIGN/SLOT=SLOT_D/2
          ASSIGN/SLOT_Z=-0.0050
          ASSIGN/COUNTER=0
          ASSIGN/X1=19.5488
          ASSIGN/XOFF=0.2005
          $$ NO,
          -----------------------------------------------------------------------------------------
          V1 =LOOP/START,ID=YES,NUMBER=196,START=1,SKIP=,
          OFFSET:XAXIS=X_offset,YAXIS=0,ZAXIS=0,ANGLE=0
          $$ NO,
          -----------------------------------------------------------------------------------------
          
          
          
          IF/V1==1
          ASSIGN/SLOT_1=0.1550
          ASSIGN/X1=19.5488
          ASSIGN/Y1=0.0009
          END_IF/
          IF/V1>1
          ASSIGN/SLOT_1=0.1551
          ASSIGN/X1=X1-XOFF
          ASSIGN/Y1=-0.0010
          END_IF/
          IF/2*ROUND(V1/2)<>V1
          ASSIGN/Y1=0.0010
          END_IF/
          $$ NO,
          -----------------------------------------------------------------------------------------
          
          $$ NO,
          -----------------------------------------------------------------------------------------
          
          $$ NO,
          -----------------------------------------------------------------------------------------
          
          $$ NO,
          -----------------------------------------------------------------------------------------
          
          PNT_01 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
          THEO/<-X1,-0.14015*1,0.1400*1>,<ZERO,ONE,ZERO>
          ACTL/<-19.3483,-0.14015,0.14>,<0,1,0>
          TARG/<-X1,-0.14015,0.1400*1>,<ZERO,ONE,ZERO>
          SNAP=NO
          SHOW FEATURE PARAMETERS=NO
          SHOW CONTACT PARAMETERS=NO
          
          PNT_02 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
          THEO/<-X1,0.14015*1,0.1400*1>,<ZERO,-ONE,ZERO>
          ACTL/<-19.3483,0.14015,0.14>,<0,-1,0>
          TARG/<-X1,0.14015*1,0.1400*1>,<ZERO,-ONE,ZERO>
          SNAP=NO
          SHOW FEATURE PARAMETERS=NO
          
          SHOW CONTACT PARAMETERS=NO
          PNT_03 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
          THEO/<-X1,0.022,ZERO>,<ZERO,ZERO,ONE>
          ACTL/<-19.3483,0.022,0>,<0,0,1>
          TARG/<-X1,0.022,ZERO>,<ZERO,ZERO,ONE>
          SNAP=NO
          SHOW FEATURE PARAMETERS=NO
          SHOW CONTACT PARAMETERS=NO
          
          PNT_04 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
          THEO/<-X1,Y1-SLOT,SLOT_Z>,<ZERO,ONE,ZERO>
          ACTL/<-19.3483,-0.0075,-0.005>,<0,1,0>
          TARG/<-X1,Y1-SLOT,SLOT_Z>,<ZERO,ONE,ZERO>
          SNAP=NO
          SHOW FEATURE PARAMETERS=NO
          SHOW CONTACT PARAMETERS=NO
          
          PNT_05 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
          THEO/<-X1,Y1+SLOT,SLOT_Z>,<ZERO,-ONE,ZERO>
          ACTL/<-19.3483,0.0095,-0.005>,<0,-1,0>
          TARG/<-X1,Y1+SLOT,SLOT_Z>,<ZERO,-ONE,ZERO>
          SNAP=NO
          SHOW FEATURE PARAMETERS=NO
          SHOW CONTACT PARAMETERS=NO
          
          PNT_06 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
          THEO/<-X1-SLOT_1/2,Y1,SLOT_Z>,<ONE,ZERO,ZERO>
          ACTL/<-19.42585,0.001,-0.005>,<1,0,0>
          TARG/<-X1-SLOT_1/2,Y1,SLOT_Z>,<ONE,ZERO,ZERO>
          SNAP=NO
          SHOW FEATURE PARAMETERS=NO
          SHOW CONTACT PARAMETERS=NO
          
          PNT_07 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
          THEO/<-X1+SLOT_1/2,Y1,SLOT_Z>,<-ONE,ZERO,ZERO>
          ACTL/<-19.27075,0.001,-0.005>,<-1,0,0>
          TARG/<-X1+SLOT_1/2,Y1,SLOT_Z>,<-ONE,ZERO,ZERO>
          SNAP=NO
          SHOW FEATURE PARAMETERS=NO
          SHOW CONTACT PARAMETERS=NO
          
          ASSIGN/PT_X[V1]=(PNT_04.X+PNT_05.X+PNT_06.X+PNT_07.X)
          ASSIGN/PT_Y[V1]=(PNT_04.Y+PNT_05.Y+PNT_06.Y+PNT_07.Y)
          ASSIGN/PT_Z[V1]=(PNT_04.Z+PNT_05.Z+PNT_06.Z+PNT_07.Z)
          ASSIGN/PT_TX[V1]=(PNT_04.TX+PNT_05.TX+PNT_06.TX+PNT_07.TX)
          ASSIGN/PT_TY[V1]=(PNT_04.TY+PNT_05.TY+PNT_06.TY+PNT_07.TY)
          ASSIGN/PT_TZ[V1]=(PNT_04.TZ+PNT_05.TZ+PNT_06.TZ+PNT_07.TZ)
          
          ASSIGN/L1[V1]=(PNT_07.X-PNT_06.X)-(PNT_07.TX-PNT_06.TX)
          
          MID_PNT=GENERIC/POINT,DEPENDENT,CARTESIAN,$
          NOM/XYZ,<PT_TX[V1],PT_TY[V1],PT_TZ[V1]>,$
          MEAS/XYZ,<PT_X[V1],PT_Y[V1],PT_Z[V1]>,$
          NOM/IJK,<0,0,1>,$
          MEAS/IJK,<0,0,1>,$
          
          
          $$ NO,
          -----------------------------------------------------------------------------------------
          
          LOOP/END
          $$ NO,
          -----------------------------------------------------------------------------------------
          
          
          SCN1 =FEAT/SET,CARTESIAN
          THEO/<0,0,0>,<0,0,1>
          ACTL/<0,0,0>,<0,0,1>
          CONSTR/SET,BASIC,MID_PNT[1..196],,
          
          LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
          THEO/<0,0,0>,<1,0,0>
          ACTL/<0,0,0>,<1,0,0>
          CONSTR/LINE,BF,SCN1
          
          ASSIGN/SLOPE=(LIN1.J/LIN1.I)
          ASSIGN/LENGTH_ERROR=SUM(L1)/196
          
          -----------------------------------------------------------------------------------------
          V2 =LOOP/START,ID=YES,NUMBER=196,START=1,SKIP=,
          OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
          
          ASSIGN/VECT1=CROSS(LN1.IJK,(actual_alignment_name).ZAXIS)
          ASSIGN/PT1="MID_PNT["+V2+"]"
          ASSIGN/E1[V2]=DOT(PT1.XYZ-LN1.XYZ,VECT1)
          LOOP/END
          
          ASSIGN/ABS_ERROR=SUM(ABS(E1))/196
          ASSIGN/S1=SUM(E1)/196
          ASSIGN/S2=E1-S1
          ASSIGN/S3=S2^2
          ASSIGN/STD_DEV=SQRT(SUM(S3)/195)
          
          $$ NO,
          -----------------------------------------------------------------------------------------
          
          ROUTINE/END
          $$ NO,

          Comment


          • rtlawlor
            rtlawlor commented
            Editing a comment
            Jeff, I have another post about trying to solve to equation for this in pcdmis, someone tagged you to it this morning. THink you can take a look at it and see if your mathlete skills can help us!

            Would be greatly appreciated.

          • JEFMAN
            JEFMAN commented
            Editing a comment
            rtlawlor : JacobCheverie is right, M and B are ok by this way !

        • #6
          PNT_01 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
          THEO/<-X1,-0.14015*1,0.1400*1>,<ZERO,ONE,ZERO>
          ACTL/<-19.3483,-0.14015,0.14>,<0,1,0>
          TARG/<-X1,-0.14015,0.1400*1>,<ZERO,ONE,ZERO>
          SNAP=NO
          SHOW FEATURE PARAMETERS=NO
          SHOW CONTACT PARAMETERS=NO
          Does -X1 actually work? I'm thinking it's always going to give zero. You want X1*-1 if you're trying to negate the value.

          Comment


          • Kp61dude!
            Kp61dude! commented
            Editing a comment
            It works to negate by a "-" and to make positive use ABS(variableName) or the trusty (one you mentioned) variableName*-1 to toggle it's axis.

          • RandomJerk
            RandomJerk commented
            Editing a comment
            Kp61dude! - I'm way too old school - in any programming language I've used in the past that would throw an error, you simply couldn't negate a variable by throwing a negative sign in front of it.

          • Kp61dude!
            Kp61dude! commented
            Editing a comment
            for sure! some syntax out there aren't very forgiving.

        • #7
          I cant do a simple loop because the Y value is changes everyone loop, and its not a simple progressive change. they range from -0.0009 to 0.0261 and there is no rime or reason to its progressive change.

          -riley Lawlor
          Southern California
          Aerospace CNC Machinery

          Comment


          • #8
            I have to do this for 196 values. I have seen a program that was a DO LOOP and in the counter it said for loop1 use these variables, for loop2 use this variables, but I don't know how to separate each variables per loop. I tried while & if statements and I couldn't get it to work. Its only 3 variables that change each time. The X, axis, the Y axis, and the slot length. But the x value is a progressive 0.2005.
            -riley Lawlor
            Southern California
            Aerospace CNC Machinery

            Comment


            • #9
              In this case, I believe that you should write values in a text file, and read them as assignments, the prog will be more readable than if you have 196 cases !!!!!!!!!

              Comment


              • #10
                Here's one example. Like JEFMAN said having 196 cases is bonkers!!! There has to be a rhyme to that Y axis or at least get it good enough to get good probe hits.

                Code:
                            ASSIGN/CNTR.2=0
                            ASSIGN/OFFSET.X=2.966
                            ASSIGN/OFFSET.Y=-.394
                            ASSIGN/OFFSET.Z=.085
                            ASSIGN/OFFSET.MLTPR=.085
                            ASSIGN/AOFFSETS.Z=ARRAY(.045,.130,.215,.300,.385,.470,.555)
                            ASSIGN/MOVEPNT.X=OFFSET.X
                            ASSIGN/MOVEPNT.Y=-.2
                            ASSIGN/MOVEPNT.Z=.555
                            ASSIGN/LOOPSETTINGS.TOG=0
                            ASSIGN/FEATLOC.X=2.966
                            ASSIGN/FEATLOC.Y=-.394
                            ASSIGN/FEATLOC.Z1=0
                            ASSIGN/FEATLOC.Z2=0
                            ASSIGN/FEATLOC.ZCALC1=.580
                            ASSIGN/FEATLOC.ZCALC2=.530
                            DO/
                $$ NO,
                            toggle settings after n loops
                
                            IF/LOOPSETTINGS.TOG==0 AND CNTR.2>6
                              ASSIGN/MOVEPNT.Z=.085
                              ASSIGN/OFFSET.Z=0
                              ASSIGN/FEATLOC.X=2.706
                              ASSIGN/FEATLOC.Y=-.094
                              ASSIGN/FEATLOC.ZCALC1=.07
                              ASSIGN/FEATLOC.ZCALC2=.02
                              ASSIGN/LOOPSETTINGS.TOG=1
                            END_IF/
                $$ NO,
                
                            settings not toggled. Loop count < n
                
                            IF/LOOPSETTINGS.TOG==0
                              ASSIGN/OFFSET.Z=OFFSET.MLTPR * CNTR.2
                              ASSIGN/FEATLOC.Z1=FEATLOC.ZCALC1 - OFFSET.Z
                              ASSIGN/FEATLOC.Z2=FEATLOC.ZCALC2 - OFFSET.Z
                            END_IF/
                            ELSE/
                  $$ NO,
                
                              settings toggled. Loop count > n
                
                              ASSIGN/=AOFFSETS.Z[(CNTR.2+1)-7]
                              ASSIGN/OFFSET.Z=OFFSET.MLTPR * ((CNTR.2)-7)
                              ASSIGN/MOVEPNT.Z=OFFSET.Z*2+AOFFSETS.Z[1]
                              ASSIGN/FEATLOC.Z1=FEATLOC.ZCALC1 + OFFSET.Z
                              ASSIGN/FEATLOC.Z2=FEATLOC.ZCALC2 + OFFSET.Z
                              ASSIGN/MOVEPNT.X=2.9
                              ASSIGN/MOVEPNT.Y=-.094
                            END_ELSE/
                            MOVE/POINT,NORMAL,<MOVEPNT.X,MOVEPNT.Y,MOVEPNT.Z - OFFSET.Z>
                PNT61      =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                            THEO/<FEATLOC.X,FEATLOC.Y,FEATLOC.Z1>,<0,0,-1>
                            ACTL/<2.706,-0.094,0.58>,<0,0,-1>
                            TARG/<FEATLOC.X,FEATLOC.Y,FEATLOC.Z1>,<0,0,-1>
                            SNAP=NO
                            SHOW FEATURE PARAMETERS=NO
                            SHOW CONTACT PARAMETERS=YES
                              AVOIDANCE MOVE=NO,DISTANCE=0.5
                            SHOW HITS=NO
                PNT62      =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                            THEO/<FEATLOC.X,FEATLOC.Y,FEATLOC.Z2>,<0,0,1>
                            ACTL/<2.706,-0.094,0.53>,<0,0,1>
                            TARG/<FEATLOC.X,FEATLOC.Y,FEATLOC.Z2>,<0,0,1>
                            SNAP=NO
                            SHOW FEATURE PARAMETERS=NO
                            SHOW CONTACT PARAMETERS=YES
                              AVOIDANCE MOVE=NO,DISTANCE=0.5
                            SHOW HITS=NO
                            ASSIGN/OFFSET.ZMID=(PNT61.Z+PNT62.Z)/2
                $$ NO,
                            features run only if loop settings toggle is true
                
                            IF/LOOPSETTINGS.TOG==0
                  $$ NO,
                              features inside this if logic is .005 offset CAD to comply with drawing.
                
                PNT63        =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                              THEO/<2.8855,-0.3311,OFFSET.ZMID>,<0.9063078,-0.4226183,0>
                              ACTL/<2.8855,-0.3311,0.045>,<0.9063078,-0.4226183,0>
                              TARG/<2.8855,-0.3311,OFFSET.ZMID>,<0.9063078,-0.4226183,0>
                              SNAP=NO
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                AVOIDANCE MOVE=NO,DISTANCE=0.5
                              SHOW HITS=NO
                PNT64        =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                              THEO/<2.7864,-0.6148,OFFSET.ZMID>,<0.9723699,-0.2334454,0>
                              ACTL/<2.7864,-0.6148,0.045>,<0.9723699,-0.2334454,0>
                              TARG/<2.7864,-0.6148,OFFSET.ZMID>,<0.9723699,-0.2334454,0>
                              SNAP=NO
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                AVOIDANCE MOVE=NO,DISTANCE=0.5
                              SHOW HITS=NO
                PNT65        =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                              THEO/<2.7459,-0.9127,OFFSET.ZMID>,<0.9993908,-0.0348995,0>
                              ACTL/<2.7459,-0.9127,0.045>,<0.9993908,-0.0348995,0>
                              TARG/<2.7459,-0.9127,OFFSET.ZMID>,<0.9993908,-0.0348995,0>
                              SNAP=NO
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                AVOIDANCE MOVE=NO,DISTANCE=0.5
                              SHOW HITS=NO
                PNT66        =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                              THEO/<2.745,-1.075,OFFSET.ZMID>,<1,0,0>
                              ACTL/<2.745,-1.075,0.045>,<1,0,0>
                              TARG/<2.745,-1.075,OFFSET.ZMID>,<1,0,0>
                              SNAP=NO
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                AVOIDANCE MOVE=NO,DISTANCE=0.5
                              SHOW HITS=NO
                PNT67        =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                              THEO/<2.7459,-1.2373,OFFSET.ZMID>,<0.9993908,0.0348995,0>
                              ACTL/<2.7459,-1.2373,0.045>,<0.9993908,0.0348995,0>
                              TARG/<2.7459,-1.2373,OFFSET.ZMID>,<0.9993908,0.0348995,0>
                              SNAP=NO
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                AVOIDANCE MOVE=NO,DISTANCE=0.5
                              SHOW HITS=NO
                PNT68        =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                              THEO/<2.7615,-1.4067,OFFSET.ZMID>,<0.9890159,0.1478094,0>
                              ACTL/<2.7615,-1.4067,0.045>,<0.9890159,0.1478094,0>
                              TARG/<2.7615,-1.4067,OFFSET.ZMID>,<0.9890159,0.1478094,0>
                              SNAP=NO
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                AVOIDANCE MOVE=NO,DISTANCE=0.5
                              SHOW HITS=NO
                PNT69        =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                              THEO/<2.7961,-1.5732,OFFSET.ZMID>,<0.9659258,0.258819,0>
                              ACTL/<2.7961,-1.5732,0.045>,<0.9659258,0.258819,0>
                              TARG/<2.7961,-1.5732,OFFSET.ZMID>,<0.9659258,0.258819,0>
                              SNAP=NO
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                AVOIDANCE MOVE=NO,DISTANCE=0.5
                              SHOW HITS=NO
                            END_IF/
                            ELSE_IF/LOOPSETTINGS.TOG==1
                PNT70        =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                              THEO/<2.711,-0.22,OFFSET.ZMID>,<0,1,0>
                              ACTL/<2.711,-0.22,0.555>,<0,1,0>
                              TARG/<2.711,-0.22,OFFSET.ZMID>,<0,1,0>
                              SNAP=NO
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=YES
                                AVOIDANCE MOVE=NO,DISTANCE=0.5
                              SHOW HITS=NO
                            END_ELSEIF/
                            RECALL/ALIGNMENT,INTERNAL,MAIN_ALN
                            MOVESPEED/ 80
                            MOVE/POINT,NORMAL,<MOVEPNT.X,MOVEPNT.Y,MOVEPNT.Z - OFFSET.Z>
                            MOVESPEED/ 125
                            ASSIGN/CNTR.2=CNTR.2 + 1
                            UNTIL/CNTR.2 > 13
                You may also want to consider creating a sub routine. Pass in XYZ as a pattern origin construction point and offset 7 points from that point and call your sub 196 times. I know...196 will require a lot of typing but hey calling a sub with parameters is still less work than 7pnts times 196 (1372 total points!).
                Last edited by Kp61dude!; 08-20-2020, 12:51 PM.
                PcDmis 2015.1 SP10 CAD++
                Global 7-10-7 DC800S

                Comment


                • #11
                  I have no experience with subroutines though.
                  -riley Lawlor
                  Southern California
                  Aerospace CNC Machinery

                  Comment


                  • neil.challinor
                    neil.challinor commented
                    Editing a comment
                    Like JEFMAN says,
                    Originally posted by JEFMAN View Post
                    In this case, I believe that you should write values in a text file, and read them as assignments, the prog will be more readable than if you have 196 cases !!!!!!!!!
                    Create a text file that has the X, Y and slot length on one line for each slot - formatted something like this...

                    123,456,789
                    234,567,890
                    987,654,321

                    So you would end up with a comma separated text file that is 196 lines long - one line for each slot.

                    In PC-Dmis, read in the text file line by line within a loop and assign your read in values to variables that you use to measure each slot...

                    Code:
                     ASSIGN/COUNT=0
                    FPTR =FILE/OPEN,MY_TEXT_FILE.TXT,READ
                    DO/
                    ASSIGN/COUNT=COUNT+1
                    V2 =FILE/READLINE,FPTR,{XVAL}+","+{YVAL}+","+{SLEN}
                    
                        code to measure your slots here using XVAL, YVAL and SLEN variables
                    
                    UNTIL/COUNT==196
                    FILE/CLOSE,FPTR,KEEP

                • #12
                  THANK YOU!!!!!!!!!! I ended up doing it the hardest pay possible. I imported all the variables, but then they didn't want the slots measured at features because they wanted local alignments updated for the wave guide, plane, and the slot y axis.

                  PNT_001 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<-X1,-0.14015*1,0.1400*1>,<ZERO,ONE,ZERO>
                  ACTL/<-19.549584,-0.139799,0.14121>,<0,1,0>
                  TARG/<-X1,-0.14015,0.1400*1>,<ZERO,ONE,ZERO>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  PNT_002 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<-X1,0.14015*1,0.1400*1>,<ZERO,-ONE,ZERO>
                  ACTL/<-19.549877,0.140799,0.14006>,<0,-1,0>
                  TARG/<-X1,0.14015*1,0.1400*1>,<ZERO,-ONE,ZERO>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  PNT_E1 =FEAT/POINT,CARTESIAN,NO
                  THEO/<-19.5488,0,0.14>,<0,0,1>
                  ACTL/<-19.549731,0.0005,0.140635>,<-0.0000421,-0.0043341,0.9999906>
                  CONSTR/POINT,MID,PNT_002,PNT_001
                  A6 =ALIGNMENT/START,RECALL:SLOTS_DCC_CSY,LIST=YES
                  ALIGNMENT/TRANS,YAXIS,PNT_E1
                  ALIGNMENT/END
                  PNT_D1 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<-X1,-0.022,ZERO>,<ZERO,ZERO,ONE>
                  ACTL/<-19.55003,-0.021264,-0.000316>,<0,0,1>
                  TARG/<-X1,-0.022,ZERO>,<ZERO,ZERO,ONE>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  A8 =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(A6),LIST=YES
                  ALIGNMENT/TRANS,ZAXIS,PNT_D1
                  ALIGNMENT/END
                  MOVE/CLEARPLANE
                  PNT_003 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<-X1,SY1-SR,-SLOT_Z>,<ZERO,ONE,ZERO>
                  ACTL/<-19.55002,-0.008406,-0.004386>,<0,1,0>
                  TARG/<-X1,SY1-SR,-SLOT_Z>,<ZERO,ONE,ZERO>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  PNT_004 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<-X1,SY1+SR,-SLOT_Z>,<ZERO,-ONE,ZERO>
                  ACTL/<-19.550017,0.008758,-0.004778>,<0,-1,0>
                  TARG/<-X1,SY1+SR,-SLOT_Z>,<ZERO,-ONE,ZERO>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  PNT_W1 =FEAT/POINT,CARTESIAN,NO
                  THEO/<-19.5488,0.0009,-0.005>,<0,0,1>
                  ACTL/<-19.550018,0.000176,-0.004582>,<-0.0000421,-0.0043341,0.9999906>
                  CONSTR/POINT,MID,PNT_003,PNT_004
                  A7 =ALIGNMENT/START,RECALL:USE_ACTIVE_ALIGNMENT(A8),LIST=YES
                  ALIGNMENT/TRANS,YAXIS,PNT_W1
                  ALIGNMENT/END
                  PNT_005 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<-X1+S1L/2,ZERO,-SLOT_Z>,<-ONE,ZERO,ZERO>
                  ACTL/<-19.471419,0.000139,-0.004893>,<-1,0,0>
                  TARG/<-X1+S1L/2,ZERO,-SLOT_Z>,<-ONE,ZERO,ZERO>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  PNT_006 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
                  THEO/<-X1-S1L/2,ZERO,-SLOT_Z>,<ONE,ZERO,ZERO>
                  ACTL/<-19.626412,-0.000101,-0.00494>,<1,0,0>
                  TARG/<-X1-S1L/2,ZERO,-SLOT_Z>,<ONE,ZERO,ZERO>
                  SNAP=NO
                  SHOW FEATURE PARAMETERS=NO
                  SHOW CONTACT PARAMETERS=NO
                  PNT_L1 =FEAT/POINT,CARTESIAN,NO
                  THEO/<-19.5488,0,-0.005>,<0,0,1>
                  ACTL/<-19.548916,0.000019,-0.004917>,<-0.0000421,-0.0043341,0.9999906>
                  CONSTR/POINT,MID,PNT_005,PNT_006
                  RECALL/ALIGNMENT,INTERNAL,SLOTS_DCC_CSY
                  MOVE/CLEARPLANE
                  A9 =ALIGNMENT/START,RECALL:SLOTS_DCC_CSY,LIST=YES
                  ALIGNMENT/TRANS,ZAXIS,PNT_D1
                  ALIGNMENT/TRANS,YAXIS,PNT_E1
                  ALIGNMENT/TRANS,XAXIS,PNT_L1
                  ALIGNMENT/END
                  MOVE/CLEARPLANE

                  x195
                  -riley Lawlor
                  Southern California
                  Aerospace CNC Machinery

                  Comment

                  Related Topics

                  Collapse

                  Working...
                  X