Rotating Alignment in Loop

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

  • Rotating Alignment in Loop

    I have recently been thwarted into the position of programming our CMM with PC-DMIS... I have successfully created a loop to measure holes in a pattern, but have not been able to rotate the alignment to each hole as it runs back through the loop... I have looked through the Forum and didn't seem to find an answer... I know this question is very basic for all of you, but I am under a time constraint as I am sure you are all used to... If someone could point me in the direction of obtaining the piece of code needed to move the alignment 4.25 degrees each time it runs through it would be greatly appreciated... My classes cant get here soon enough!!!

  • #2
    Use paste with pattern and skip the looping?!

    Comment


    • #3
      I' not at the cmm, but I think you can create an assignment before the loop (for example V1=0), then the first alignment before the loop, open the loop create an alignment with just rotate the line of V1, measure and ASSIGN/V1=V1+4.25 and end the loop.
      It should work...
      Have a good week-end, all !

      Comment


      • #4
        Thank you guys for the help... Too much of a noob to execute your suggestions.... Trying to teach myself before I am sent to training to help the company in a pickle, but I don't want to bother you guys with simplistic questions, but I do appreciate your replies...

        Comment


        • #5
          Originally posted by GOFOBROKE View Post
          Thank you guys for the help... Too much of a noob to execute your suggestions.... Trying to teach myself before I am sent to training to help the company in a pickle, but I don't want to bother you guys with simplistic questions, but I do appreciate your replies...
          Theyre all very helpful on here when I ask simple questions so I imagine they will do the same for you.

          I would say though that in your defence, your question is not too simplistic. I dont think what you are asking would generally be covered in level 1 or 2 training.

          Comment


          • #6
            Originally posted by bigtallanddopey View Post
            Theyre all very helpful on here when I ask simple questions so I imagine they will do the same for you.

            I would say though that in your defence, your question is not too simplistic. I dont think what you are asking would generally be covered in level 1 or 2 training.
            Thank you for the defense... I have seen and understand why the board members are not here to teach noobs, so I don't want to annoy... In my inexperience, I just didn't quite understand what the process they wanted me to execute.... I am gaining on it though...

            Comment


            • #7
              If you have code that you are trying to manipulate, and want better results from the members of this board:

              [c0de]
              specific program code here
              [/c0de]

              just swap the 0 for the letter o.

              We all had to start somewhere!

              Comment


              • #8
                Code:
                 A2         =ALIGNMENT/START,RECALL:FINAL ABC,LIST=YES
                              ALIGNMENT/LEVEL,ZPLUS,DATUM A
                              ALIGNMENT/TRANS,ZAXIS,DATUM A
                              ALIGNMENT/TRANS,XAXIS,DATUM B
                              ALIGNMENT/TRANS,YAXIS,DATUM B
                              ALIGNMENT/ROTATE_CIRCLE,XPLUS,TO,DATUM B,AND,DATUM C,ABOUT,ZPLUS
                              ALIGNMENT/ROTATE_OFFSET,74.2237,ABOUT,ZPLUS
                            ALIGNMENT/END
                            ASSIGN/CTR=0
                            ASSIGN/ROTATE_OFFSET=74.2237
                LOOP       =LOOP/START,ID=YES,NUMBER=3,START=1,SKIP=,
                              OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=4.25
                ROTATION     =ALIGNMENT/START,RECALL:A2,LIST=YES
                                ALIGNMENT/ROTATE_CIRCLE,XPLUS,TO,DATUM B,AND,DATUM C,ABOUT,ZPLUS
                                ALIGNMENT/ROTATE_OFFSET,74.2237,ABOUT,ZPLUS
                              ALIGNMENT/END
                            DO/
                            ASSIGN/CTR=CTR+1
                            IF/CTR>=0
                              ASSIGN/ROTATE_OFFSET=CTR*4.25+74.2237
                            END_IF/
                FLANGE HOLE=FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                            THEO/<10.302,0,0>,<0,0,1>,0.406
                            ACTL/<10.2986,0.0023,0>,<0,0,1>,0.408
                            TARG/<10.302,0,0>,<0,0,1>
                            START ANG=0,END ANG=360
                            ANGLE VEC=<0.5628049,-0.8265898,0>
                            DIRECTION=CCW
                            SHOW FEATURE PARAMETERS=NO
                            SHOW CONTACT PARAMETERS=NO
                DIM FLANGE HOLE DIM= LOCATION OF CIRCLE FLANGE HOLE  UNITS=IN ,$
                GRAPH=OFF  TEXT=OFF  MULT=0.00  OUTPUT=BOTH  HALF ANGLE=NO
                AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
                Y       0.0000     0.0050     0.0050     0.0023     0.0023     0.0000 ------#--
                PR     10.3020     0.0050     0.0050    10.2986    -0.0034     0.0000 -#-------
                PA      0.0000     1.0000     1.0000     0.0131     0.0131     0.0000 ----#----
                D       0.4060     0.0050     0.0050     0.4080     0.0020     0.0000 ------#--
                END OF DIMENSION FLANGE HOLE DIM
                FLANGE HOLE POSITION =POSITION : FLANGE HOLE
                            FEATCTRLFRAME/SHOWNOMS=NO,SHOWPARAMS=YES,SHOWEXPANDED=YES
                            CADGRAPH=OFF,REPORTGRAPH=OFF,TEXT=OFF,MULT=0.00,ARROWDENSITY=100,OUTPUT=BOTH,UNITS=IN
                            COMPOSITE=NO,FIT TO DATUMS=YES,DEV PERPEN CENTERLINE=ON,OUTPUT ALIGNMENT=Datum Reference Frame
                            CUSTOMIZED DRF=NO
                            STANDARDTYPE=ASME_Y14_5
                              SIZE TOLERANCES/1,DIAMETER,0.406,0.005,0.005
                              PRIMARY DIMENSION/POSITION,DIAMETER,0.01,MMC,A,B,<MC>,C,<MC>
                              SECONDARY DIMENSION/<Dim>,<tol>,<MC>,<dat>,<dat>,<dat>
                              NOTE/FLANGE HOLE POSITION
                            FEATURES/FLANGE HOLE,,
                            UNTIL/CTR==4
                            LOOP/END

                Comment


                • #9
                  Originally posted by GOFOBROKE View Post
                  I have recently been thwarted into the position of programming our CMM with PC-DMIS...
                  Hello and welcome to our world!




                  Originally posted by GOFOBROKE View Post
                  Code:
                   A2         =ALIGNMENT/START,RECALL:FINAL ABC,LIST=YES
                                ALIGNMENT/LEVEL,ZPLUS,DATUM A
                                ALIGNMENT/TRANS,ZAXIS,DATUM A
                                ALIGNMENT/TRANS,XAXIS,DATUM B
                                ALIGNMENT/TRANS,YAXIS,DATUM B
                                ALIGNMENT/ROTATE_CIRCLE,XPLUS,TO,DATUM B,AND,DATUM C,ABOUT,ZPLUS
                                ALIGNMENT/ROTATE_OFFSET,74.2237,ABOUT,ZPLUS
                              ALIGNMENT/END
                              ASSIGN/CTR=0
                              ASSIGN/ROTATE_OFFSET=74.2237
                  LOOP       =LOOP/START,ID=YES,NUMBER=3,START=1,SKIP=,
                                OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=4.25
                  ROTATION     =ALIGNMENT/START,RECALL:A2,LIST=YES
                                  ALIGNMENT/ROTATE_CIRCLE,XPLUS,TO,DATUM B,AND,DATUM C,ABOUT,ZPLUS
                                  ALIGNMENT/ROTATE_OFFSET,74.2237,ABOUT,ZPLUS
                                ALIGNMENT/END
                              DO/
                              ASSIGN/CTR=CTR+1
                              IF/CTR>=0
                                ASSIGN/ROTATE_OFFSET=CTR*4.25+74.2237
                              END_IF/
                  FLANGE HOLE=FEAT/CONTACT/CIRCLE/DEFAULT,CARTESIAN,IN,LEAST_SQR
                              THEO/<10.302,0,0>,<0,0,1>,0.406
                              ACTL/<10.2986,0.0023,0>,<0,0,1>,0.408
                              TARG/<10.302,0,0>,<0,0,1>
                              START ANG=0,END ANG=360
                              ANGLE VEC=<0.5628049,-0.8265898,0>
                              DIRECTION=CCW
                              SHOW FEATURE PARAMETERS=NO
                              SHOW CONTACT PARAMETERS=NO
                  DIM FLANGE HOLE DIM= LOCATION OF CIRCLE FLANGE HOLE  UNITS=IN ,$
                  GRAPH=OFF  TEXT=OFF  MULT=0.00  OUTPUT=BOTH  HALF ANGLE=NO
                  AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
                  Y       0.0000     0.0050     0.0050     0.0023     0.0023     0.0000 ------#--
                  PR     10.3020     0.0050     0.0050    10.2986    -0.0034     0.0000 -#-------
                  PA      0.0000     1.0000     1.0000     0.0131     0.0131     0.0000 ----#----
                  D       0.4060     0.0050     0.0050     0.4080     0.0020     0.0000 ------#--
                  END OF DIMENSION FLANGE HOLE DIM
                  FLANGE HOLE POSITION =POSITION : FLANGE HOLE
                              FEATCTRLFRAME/SHOWNOMS=NO,SHOWPARAMS=YES,SHOWEXPANDED=YES
                              CADGRAPH=OFF,REPORTGRAPH=OFF,TEXT=OFF,MULT=0.00,ARROWDENSITY=100,OUTPUT=BOTH,UNITS=IN
                              COMPOSITE=NO,FIT TO DATUMS=YES,DEV PERPEN CENTERLINE=ON,OUTPUT ALIGNMENT=Datum Reference Frame
                              CUSTOMIZED DRF=NO
                              STANDARDTYPE=ASME_Y14_5
                                SIZE TOLERANCES/1,DIAMETER,0.406,0.005,0.005
                                PRIMARY DIMENSION/POSITION,DIAMETER,0.01,MMC,A,B,<MC>,C,<MC>
                                SECONDARY DIMENSION/<Dim>,<tol>,<MC>,<dat>,<dat>,<dat>
                                NOTE/FLANGE HOLE POSITION
                              FEATURES/FLANGE HOLE,,
                              UNTIL/CTR==4
                              LOOP/END
                  This looks complicated. You may be over-thinking it.
                  Is this a single polar pattern of holes where each hole is dimensioned for Position back to AB(M)C(M)?

                  Comment


                  • #10
                    Yes, I am trying to teach myself with a simple pattern of flange holes in hopes to set up a more complicated rotation

                    Comment


                    • #11
                      You might be better off (as someone has mentioned) using Paste with pattern.

                      No doubt looping can be a useful tool, but there are many nuances to it when used within PC-dmis which make it tricky to say the least. For example if you want to construct a PCD from your bolt holes you need to type them in using an index CIR1[1],CIR1[2] etc, plus if you run any VB scripts which export data to excel, you might find it only sees one circle.

                      I came to pc-dmis with some coding experience (so was very confortable with loops etc) but pretty quickly decided paste with pattern was my preffered option.

                      If you definitely want to use looping, then you might want to read up on 'Reset global settings when branching' option. (This is set on the general tab of the setup dialog - Edit > Prefs > Setup).


                      If I was going to do it using a loop I'd probably do it using external alignments...


                      psudo code below


                      Align ABC
                      Rotate 74.2237
                      Save alignment external (i.e TEMPALIGN.ALN)
                      Loop Start
                      Recall TEMPALIGN
                      Meas Circ
                      Report
                      Align, Recall TEMPALIGN, Rotate 4.25
                      Save alignment external (i.e TEMPALIGN.ALN)
                      Loop end
                      Automettech - Automated Metrology Technology

                      Comment


                      • #12
                        Originally posted by NinjaBadger View Post
                        You might be better off (as someone has mentioned) using Paste with pattern.

                        No doubt looping can be a useful tool, but there are many nuances to it when used within PC-dmis which make it tricky to say the least. For example if you want to construct a PCD from your bolt holes you need to type them in using an index CIR1[1],CIR1[2] etc, plus if you run any VB scripts which export data to excel, you might find it only sees one circle.

                        I came to pc-dmis with some coding experience (so was very confortable with loops etc) but pretty quickly decided paste with pattern was my preffered option.

                        If you definitely want to use looping, then you might want to read up on 'Reset global settings when branching' option. (This is set on the general tab of the setup dialog - Edit > Prefs > Setup).


                        If I was going to do it using a loop I'd probably do it using external alignments...


                        psudo code below


                        Align ABC
                        Rotate 74.2237
                        Save alignment external (i.e TEMPALIGN.ALN)
                        Loop Start
                        Recall TEMPALIGN
                        Meas Circ
                        Report
                        Align, Recall TEMPALIGN, Rotate 4.25
                        Save alignment external (i.e TEMPALIGN.ALN)
                        Loop end
                        Thank you for that and I will definitely try it out... My end goal to learn the looping option is due to a complicated series of measurements we have with the project I am working on that will also involve rotating the probe, but I wanted to work it out one step at a time... First was getting the loop to work right for measuring and dimensioning, then rotating the alignment and so on... Everyones help is greatly appreciated...

                        Comment


                        • #13
                          I hve not been successful in the past rotating alignment usong paste and pattern, i had to modify the align where it would recall the previous align. Otherwise it will always recall the same align over and over and the paste will be in the same location.
                          Last edited by WolfMan; 09-14-2015, 11:53 AM.
                          B&S One
                          PC-DMIS CAD v2014

                          Romer Infinity

                          Comment


                          • #14
                            Originally posted by GOFOBROKE View Post
                            Thank you for the defense... I have seen and understand why the board members are not here to teach noobs, so I don't want to annoy... In my inexperience, I just didn't quite understand what the process they wanted me to execute.... I am gaining on it though...
                            Posting a print or a shot screen always helps. Prin better e
                            B&S One
                            PC-DMIS CAD v2014

                            Romer Infinity

                            Comment


                            • #15
                              Originally posted by GOFOBROKE View Post
                              Yes, I am trying to teach myself with a simple pattern of flange holes in hopes to set up a more complicated rotation
                              Well I give you an A+ extra credit gold star for effort, for you have gone far further than any newbie I have ever seen. You must have some programming background?

                              However you've gone a little too far. Let's walk before we learn to run...

                              First, some basic user interface stuff:

                              1) It's not text format code, it's a UI that looks like it. It's a grid overlaying a deep well of living writhing code. Looking at it, you see some blue and some black text. The blue fields are open to user input, either free typing or restricted to a list of possible items. The black is not editable. That code you copy-pasted over here cannot be pasted back.

                              2) Time traveling cursor. Where you click the cursor in the lines of code is where the software is thinking. Click before a feature, and the feature has not happened yet. Click after it and travel forward in time to after the feature completed.

                              3) The deep well is continually running lines of communication between items that are related, such as a feature and a dimension that references it. Edit your feature's name and presto! The name shown in the dimension automatically updated.

                              4) Due to the continual self-examination, take care to only use safe character strings in Names - not characters that are math operations. The super-safe rule-of-thumb is LETTERS_NUMBERS_UNDERSCORES_ONLY, though spaces and dashes can be used sometimes.

                              5) All code after an Alignment is relative to that alignment. Changing the alignment makes PC-DMIS want to change everything after the alignment.

                              ~~~

                              Now into the advanced stuff you will NOT learn in Level 101. (FYI I work for Hexagon and teach the classes).

                              Due to #5 above, having alignment changes inside loops is a dangerous business where much care must be taken.
                              The loop has a built-in alignment shift, yours has the 4.25 correctly input. That should be perfectly sufficient. Doubling down with an alignment with an additional rotational shift inside the loop is asking for trouble - and worse yet making the shift itself a variable digs you into a deeper hole of possibly corrupting your features.

                              ---> If you need an alignment inside a loop, it is mandatory that the alignment control all 6 degrees of freedom.

                              ---> If you need to make an alignment shift a variable, be forewarned that PC-DMIS will automatically shift all feature nominals by the amount that the variable's value changes after initial creation. There is an F5 checkbox that will prevent this, however it has the side effect on completely divorcing your alignment from the CAD file so it cannot be used with CAD.
                              The alignment shifts performed by the Loop's built-in offsets is protected from this as long as there's either no alignment or an alignment with all 6 DOF in the loop, so it's safe to use a variable in the Loop's offset field.

                              If you want a different less-fancy way to skin this particular cat, copy-paste-with-pattern is a great way to create a bunch of discrete hard-coded features to apply the dimensions to. Boom, done. Easy to diagnose problems with each one, easy to execute one at a time, and no chance of corruption. With all types of coding, simplicity is a valuable asset.

                              Clear as mud?

                              Comment

                              Related Topics

                              Collapse

                              • JBELL
                                Another Loop Question
                                by JBELL
                                I have searched with no luck for an answer. I am very new to looping and have some questions. Right now, I am doing a Man align then loop commands then...
                                11-04-2015, 03:58 PM
                              • Kingkrab
                                Attention Loop Masters
                                by Kingkrab
                                So I have 16 parts I need to measure in a 4 rows of 4 pattern. It's a simple 5 hole bolt pattern concentric to the I.D. Plane on the flange and level...
                                10-10-2014, 07:10 AM
                              • DeWain Hodge
                                Looping question
                                by DeWain Hodge
                                I was asked a question but one of our new inspectors when we were discussing looping. Say you have five parts you want to setup and measures all five....
                                09-15-2016, 04:37 PM
                              • Donny Wallbanger
                                Looping a Loop?
                                by Donny Wallbanger
                                Good morning all I hope you are all having a good day, I have a program that contains a simple loop to check multiple pockets on a valve rotator body,...
                                01-13-2017, 05:37 AM
                              • arock
                                looping??
                                by arock
                                Trying to figure out this looping.... I got as far as taking the first feature of the alignment on the second part! Then it went way over in space and...
                                06-14-2018, 09:44 AM
                              Working...
                              X