hexagon logo

How do you get data from a loop?

Hey everyone,

I'm still new and learning PC-DMIS. I want to learn more about looping and variables as I can see it being an important tool to make programming quicker.

So I have a round part and it has 12 tabs around it every 30 degrees. What I want is for it to loop around the part grabbing a point on the outer tab. After I want to construct a circle (best fit) and output the dia for my report.

How can I go about this?

So the code I have so far is this
V1         =LOOP/START,ID=YES,NUMBER=12,START=1,SKIP=,
              OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=30
OUTER-RAD-TAB_1  =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
              THEO/<0,-7.546,-0.15>,<0,-1,0>
              ACTL/<0,-7.546,-0.15>,<0,-1,0>
              TARG/<0,-7.546,-0.15>,<0,-1,0>
              SNAP=NO
              SHOW FEATURE PARAMETERS=NO
              SHOW CONTACT PARAMETERS=YES
                AVOIDANCE MOVE=NO,DISTANCE=0
              SHOW HITS=NO
            LOOP/END​
Parents
  • Looping in PC-Dmis is tricky (coming from other softwares, or other types of programming in general it's difficult to let go of this concept but it's never straightforward) -and I'm not one to say because something is difficult it shouldn't be done.

    Looping programs (measuring multiple parts is okay) but whilst looping sections of a program as you are suggesting is possible, paste with pattern is the preferred method.

    The same is true for subroutines, it's the passing of data back and forth that's prohibitive.



Reply
  • Looping in PC-Dmis is tricky (coming from other softwares, or other types of programming in general it's difficult to let go of this concept but it's never straightforward) -and I'm not one to say because something is difficult it shouldn't be done.

    Looping programs (measuring multiple parts is okay) but whilst looping sections of a program as you are suggesting is possible, paste with pattern is the preferred method.

    The same is true for subroutines, it's the passing of data back and forth that's prohibitive.



Children
No Data