loop

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

  • loop

    Never tried looping in PCDMIS but done it a million times in MM4, I seem to get the points taken and see that I might have to use a array to find the high point, but to went to look at features measured and I do not see them. So I'm guessing again this will have to be done thru an array. What is the code or extensions that I use in my array. The 1st point is PNT2[1]. I hope this is clear. WDE
    sigpic

  • #2
    I think I got but.....like to see if im correct.
    sigpic

    Comment


    • #3
      You can create a feature set after the loop with PNT2[1..xx], and then search the high point.
      With an aray, you have to use the loop variable (ex : V1) and create the array by ASSIGN/V2[V1]=PNT2.Z inside the loop.
      You will search the max z after the loop by ASSIGN/V3=MAX(V2) or max index.

      Comment


      • #4
        V1 =LOOP/START,ID=YES,NUMBER=20,START=1,SKIP=,
        OFFSET:XAXIS=0.01,YAXIS=0,ZAXIS=0,ANGLE=0
        PNT2 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
        THEO/<-0.1,0.318,-0.1>,<0,1,0>
        ACTL/<-0.1,0.318,-0.1>,<0,1,0>
        TARG/<-0.1,0.318,-0.1>,<0,1,0>
        SNAP=NO
        SHOW FEATURE PARAMETERS=NO
        SHOW CONTACT PARAMETERS=NO
        LOOP/END
        HIGH =FEAT/SET,CARTESIAN
        THEO/<-0.0275,0.318,-0.1>,<0,0,1>
        ACTL/<-0.0275,0.3211,-0.1>,<0,0,1>
        CONSTR/SET,BASIC,PNT2[1..20],,
        MOVE/CLEARPLANE

        I added the feature HIGH but was going to do it like below

        ASSIGN/V1=ARRAY(PNT2[1].Y,PNT2[2].Y,PNT2[3].Y,PNT2[4].Y,PNT2[5].Y,PNT2[6].Y,PNT2[7].Y,PNT2[8].Y,PNT2[9].Y,PNT2[10].Y,PNT2[11].Y,PNT2[12].Y,PNT2[13].Y,PNT2[14].Y, PNT2[15].Y,PNT2[16].Y,PNT2[17].Y,PNT2[18].Y,PNT2[19].Y,PNT2[20].Y)
        ASSIGN/V2=MIN(V1)
        ASSIGN/V3=MAX(V1)

        confused with the feature set how to retrieve the high point
        sigpic

        Comment


        • #5
          Just run the part and noticed the Z actual of the HIGH = FEATURE/SET is showing .3211 so is that my answer.
          sigpic

          Comment


          • #6
            V1 =LOOP/START,ID=YES,NUMBER=20,START=1,SKIP=,
            OFFSET:XAXIS=0.01,YAXIS=0,ZAXIS=0,ANGLE=0
            PNT2 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
            THEO/<-0.1,0.318,-0.1>,<0,1,0>
            ACTL/<-0.1,0.318,-0.1>,<0,1,0>
            TARG/<-0.1,0.318,-0.1>,<0,1,0>
            SNAP=NO
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            LOOP/END
            HIGH =FEAT/SET,CARTESIAN
            THEO/<-0.0275,0.318,-0.1>,<0,0,1>
            ACTL/<-0.0275,0.3211,-0.1>,<0,0,1>
            CONSTR/SET,BASIC,PNT2[1..20],,
            MOVE/CLEARPLANE
            ASSIGN/V2=MAX(HIGH.Y)

            or

            V1 =LOOP/START,ID=YES,NUMBER=20,START=1,SKIP=,
            OFFSET:XAXIS=0.01,YAXIS=0,ZAXIS=0,ANGLE=0
            PNT2 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
            THEO/<-0.1,0.318,-0.1>,<0,1,0>
            ACTL/<-0.1,0.318,-0.1>,<0,1,0>
            TARG/<-0.1,0.318,-0.1>,<0,1,0>
            SNAP=NO
            SHOW FEATURE PARAMETERS=NO
            SHOW CONTACT PARAMETERS=NO
            ASSIGN/V2[V1]=PNT2.Y
            LOOP/END
            ASSIGN/V3=MAX(V2)

            Comment


            • AuRules
              AuRules commented
              Editing a comment
              Thanks JEFMAN I used the upper always seems to more than one way to skin a cat. Work awesome.

          • #7
            Loops are both a monster to fully grasp in PcDmis and a powerhouse of a skill once tamed. Learn them here and if you every get into almost any 3rd generation code it'll be much easier.
            PcDmis 2015.1 SP10 CAD++
            Global 7-10-7 DC800S

            Comment

            Related Topics

            Collapse

            Working...
            X