Loops and feature construction ?????

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

  • Loops and feature construction ?????

    I need some education regarding loops and the features created within them.
    Scenario:
    Working on Ralph Barriers bearing race project I proposed checking the race as a sphere in 4 quadrants, pulling the points from the 4 sphere features to check the race profile and then using all the points for a final sphere feature for location.

    I tested this idea on my cal sphere. I got 4 good sphere features around the sphere. I set up a loop to create points and saw them appear in the graphics area as sph1pt[1] thru sph1pt[9] and repeated for the other three spheres.

    Next I wanted to analyze each point for a profile check but I don’t find them in the selection window to click on (dimension toolbar, location). That is problem 1 that I would like some education on.

    Then I wanted to create the final sphere using all the points. Same thing, when I try to construct a sphere I don’t find my loop created points in the selection window.

    I had no problem when I coded each point creation manually one at a time (no loop). I did run into this, couldn’t use “construct sphere / sph1.hit[1…9]” or “construct sphere / sph1.hit[all]. I had to create the final sphere the long drawn out method “construct sphere / sph1pt1, sph1pt2, sph1pt3 etc. The demon didn’t give me RED code in the edit window when I tried the first 2 methods so I think I got the syntax correct but the sphere created in the graphics window had the wrong location (way wrong).

    Any thoughts, folks?

    TK
    sigpicHave a homebrew

  • #2
    Let me think about it. I think I know what you are doing. You might want to consider assigning variables to hold your sphere data then construction from the variables but I have to give this some thought as to how to pull it off. I don't believe the way you are doing it will work. This is a tricky one. How about some code to kick this one off?

    Craig
    <internet bumper sticker goes here>

    Comment


    • #3
      I believe I have the idea of what you what to accomplish. I not sure if it will work. You could use Paste with pattern to establish the features you wish to recall.
      Windows 7
      Pc-Dmis 2015
      Global Performance 7-10-7


      Comment


      • #4
        This works but it's not the way I wanted to do it!

        TK

        STARTUP =ALIGNMENT/START,RECALL:, LIST= YES
        ALIGNMENT/END
        MODE/MANUAL
        LOADPROBE/PROBE2CYL45LONG
        TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=90
        COMMENT/DOC,NO,Sphere nominal would be the xyz oigin, moves
        ,in and out for probe index all yours
        FIRST =FEAT/SPHERE,RECT,OUT
        THEO/1729.282,455.357,-698.038,0,0,1,12.692
        ACTL/1728.335,458.603,-667.165,0,0,1,12.69
        MEAS/SPHERE,5
        HIT/BASIC,NORMAL,1728.921,455.419,-691.703,-0.0568716,0.0097081,0.9983343,1728.632,458.514,-660.828,USE THEO = YES
        MOVE/CIRCULAR
        HIT/BASIC,NORMAL,1728.921,449.045,-697.514,-0.056887,-0.9949528,0.0826605,1728.631,452.303,-666.506,USE THEO = YES
        MOVE/CIRCULAR
        HIT/BASIC,NORMAL,1722.966,455.738,-697.513,-0.9947656,0.0599587,0.0827426,1722.024,458.403,-666.506,USE THEO = YES
        MOVE/CIRCULAR
        HIT/BASIC,NORMAL,1727.606,461.453,-697.514,-0.2640682,0.9609485,0.0827408,1729.133,464.859,-666.506,USE THEO = YES
        MOVE/CIRCULAR
        HIT/BASIC,NORMAL,1735.508,454.233,-697.513,0.9807184,-0.17707,0.0826898,1734.615,457.936,-666.507,USE THEO = YES
        ENDMEAS/
        A1 =ALIGNMENT/START,RECALL:STARTUP, LIST= YES
        ALIGNMENT/TRANS,XAXIS,FIRST
        ALIGNMENT/TRANS,YAXIS,FIRST
        ALIGNMENT/TRANS,ZAXIS,FIRST
        ALIGNMENT/END
        MODE/DCC
        TIP/T1A90B0, SHANKIJK=-1, 0, 0, ANGLE=90
        SPH1 =AUTO/SPHERE,SHOWALLPARAMS = YES,SHOWHITS = NO
        THEO/0,0,0,0,0,1,12.7
        ACTL/-0.074,0.058,-0.003,0,0,1,12.677
        TARG/0,0,0,0,0,1
        THEO_THICKNESS = 0,RECT,OUT,$
        AUTO MOVE = BOTH,DISTANCE = 15,$
        NUMHITS = 9,NUMROWS = 3,INIT = 0,PERM = 0,SPACER = 0,$
        START ANGLE 1 = 230,END ANGLE 1 = 140,$
        START ANGLE 2 = -10,END ANGLE 2 = 10,$
        ANGLE VEC = 1,0,0
        MOVE/INCREMENT,0,0,50
        TIP/T1A90B-90, SHANKIJK=0, 1, 0, ANGLE=180
        SPH2 =AUTO/SPHERE,SHOWALLPARAMS = YES,SHOWHITS = NO
        THEO/0,0,0,0,0,1,12.7
        ACTL/-0.057,0.061,0.01,0,0,1,12.671
        TARG/0,0,0,0,0,1
        THEO_THICKNESS = 0,RECT,OUT,$
        AUTO MOVE = BOTH,DISTANCE = 15,$
        NUMHITS = 9,NUMROWS = 3,INIT = 0,PERM = 0,SPACER = 0,$
        START ANGLE 1 = 230,END ANGLE 1 = 140,$
        START ANGLE 2 = -10,END ANGLE 2 = 10,$
        ANGLE VEC = 0,-1,0
        MOVE/INCREMENT,0,0,50
        TIP/T1A90B180, SHANKIJK=1, 0, 0, ANGLE=-90
        SPH3 =AUTO/SPHERE,SHOWALLPARAMS = YES,SHOWHITS = NO
        THEO/0,0,0,0,0,1,12.7
        ACTL/-0.049,0.019,0.006,0,0,1,12.667
        TARG/0,0,0,0,0,1
        THEO_THICKNESS = 0,RECT,OUT,$
        AUTO MOVE = BOTH,DISTANCE = 15,$
        NUMHITS = 9,NUMROWS = 3,INIT = 0,PERM = 0,SPACER = 0,$
        START ANGLE 1 = 230,END ANGLE 1 = 140,$
        START ANGLE 2 = -10,END ANGLE 2 = 10,$
        ANGLE VEC = -1,0,0
        MOVE/INCREMENT,0,0,50
        TIP/T1A90B90, SHANKIJK=0, -1, 0, ANGLE=180
        SPH4 =AUTO/SPHERE,SHOWALLPARAMS = YES,SHOWHITS = NO
        THEO/0,0,0,0,0,1,12.7
        ACTL/-0.093,0.017,-0.006,0,0,1,12.691
        TARG/0,0,0,0,0,1
        THEO_THICKNESS = 0,RECT,OUT,$
        AUTO MOVE = BOTH,DISTANCE = 15,$
        NUMHITS = 9,NUMROWS = 3,INIT = 0,PERM = 0,SPACER = 0,$
        START ANGLE 1 = 230,END ANGLE 1 = 140,$
        START ANGLE 2 = -10,END ANGLE 2 = 10,$
        ANGLE VEC = 0,1,0
        MOVE/INCREMENT,0,0,50
        S1P1 =FEAT/POINT,RECT
        THEO/-3.127,-5.416,-1.103,-0.4924039,-0.8528685,-0.1736482
        ACTL/-4.014,-4.785,-1.107,-0.6330222,-0.7544065,-0.1736482
        CONSTR/POINT,CAST,SPH1.HIT[1]
        S1P2 =FEAT/POINT,RECT
        THEO/-4.02,4.79,1.103,-0.6330222,0.7544065,0.1736482
        ACTL/-4.05,4.85,1.132,-0.6330222,0.7544065,0.1736482
        CONSTR/POINT,CAST,SPH1.HIT[2]
        S1P3 =FEAT/POINT,RECT
        THEO/-4.02,4.79,1.103,-0.6330222,0.7544065,0.1736482
        ACTL/-4.05,4.85,1.132,-0.6330222,0.7544065,0.1736482
        CONSTR/POINT,CAST,SPH1.HIT[3]

        Done the same way till I have all the points from all 4 sphere sections as an individual / selectable point.

        SPH5 =FEAT/SPHERE,RECT,OUT
        THEO/0,0,-18.284,0,0,1,12.7
        ACTL/-0.067,0.024,0.079,0,0,1,12.697
        CONSTR/SPHERE,BF,S1P1,S1P2,S1P3,S1P4,S1P5,S1P6,S1P7,S1P8, S1P9,S2P1,S2P2,S2P3,S2P4,S2P5,S2P6,S2P7,S2P8,S2P9, S3P1,S3P2,S3P3,S3P4,S3P5,S3P6,S3P7,S3P8,S3P9,S4P1, S4P2,S4P3,S4P4,S4P5,S4P6,S4P7,S4P8,S4P9,,
        FORMAT/TEXT, ,ID,HEADINGS, , ;MEAS,NOM,TOL,DEV,OUTTOL, ,
        DIM LOC1= LOCATION OF SPHERE SPH5
        AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
        D 12.697 12.700 0.050 0.050 -0.003 0.000
        RN 0.027 0.000 0.050 0.000 0.027 0.000
        END OF DIMENSION LOC1
        Last edited by tking; 07-12-2006, 11:44 AM.
        sigpicHave a homebrew

        Comment


        • #5
          OK you could do this and it will be tricky but does work. Do one sphere, that's right one feature. Use show hits on your auto spheres. Then go and copy and paste each tip ratation and movepoint along with all the hits in the auto sphere into your one sphere. Just like it measures the separate spheres then moves, rotates, then measures another one this will all take place in one feature. Then you don't need to construct. I am not sure that solves what you are after but looping I don't think would be worth it by the time you got done coding it. What you are doing above is probably better than looping. Hope this helps I know it is not the answer you were after. I hope someone else weighs in as I think it is a neat problem.

          Craig
          <internet bumper sticker goes here>

          Comment


          • #6
            Originally posted by craiger_ny
            OK you could do this and it will be tricky but does work. Do one sphere, that's right one feature. Use show hits on your auto spheres. Then go and copy and paste each tip ratation and movepoint along with all the hits in the auto sphere into your one sphere. Just like it measures the separate spheres then moves, rotates, then measures another one this will all take place in one feature. Then you don't need to construct. I am not sure that solves what you are after but looping I don't think would be worth it by the time you got done coding it. What you are doing above is probably better than looping. Hope this helps I know it is not the answer you were after. I hope someone else weighs in as I think it is a neat problem.

            Craig
            I think I understand, however, Matt the MAN left me with a tidbit, won't only the probe comp from the last tip in the sequence be the one to comp all the points? Don't want that. Still, without this somewhat different task to do, how can I select points created in the loop? I did this type of thing all the time in MM4, the demon has gotta be able to do so as well.

            TK
            sigpicHave a homebrew

            Comment


            • #7
              Originally posted by tking
              ..........how can I select points created in the loop? I did this type of thing all the time in MM4, the demon has gotta be able to do so as well.

              TK
              I don't think you can. I belive PCDMIS stores these "features" (it is really one feature looped) only durring execution time and disposes of them once execution is over. Sounds like Measure Max has one up on that one. There may be something I don't know though.

              Craig
              <internet bumper sticker goes here>

              Comment


              • #8
                Originally posted by craiger_ny
                I don't think you can. I belive PCDMIS stores these "features" (it is really one feature looped) only durring execution time and disposes of them once execution is over. Sounds like Measure Max has one up on that one. There may be something I don't know though.

                Craig
                That's MicroMeasure IV (B&S). OK, how might I give each point a unique name based in the current loop number? In MM4 that was a variable called "loop.curr", a very sweet programming tool.

                TK
                sigpicHave a homebrew

                Comment


                • #9
                  Originally posted by tking
                  That's MicroMeasure IV (B&S). OK, how might I give each point a unique name based in the current loop number? In MM4 that was a variable called "loop.curr", a very sweet programming tool.

                  TK
                  I have a similar problem.

                  I have a laser beam whose direction I want to measure. I can do this by positioning a photodiode in the beam and measuring the position of the photodiode mount. I can then move the photodiode along the beam and repeat the process. I can choose a particular point on the photodiode mount (which has been measured with the photodiode in different places along the beam) and then construct a line through these points to get the beam direction.

                  I'd like to use a loop or subroutine to measure the position of the photodiode but need some of the data measured in the loop later in the program. I can do the measurement using a simple program that does each measurement seperately, but this is quickly going to become a very long and unpleasant program with lots of lumps of almost identical code.

                  I almost succeeded using a program that loops through the measurement. the measuring worked fine, but constructing the line failed as althought the measured points on the photodiode were different (as they should be) the theoretical ones were all the same, and constructing a line through 3 identical points will always fail!

                  This seems to me exactly where a loop or subroutine should be able to help, but I haven't succeeded yet so any help would be greatly appreciated

                  Dave

                  Comment


                  • #10
                    I believe it is possible to pass the measured point data from each spere into a subroutine where you would have variablized auto features, then pull that data back into the program utilitizing another subroutine to get what you want. Craiger is correct though about PC-DMIS disposing of the loop dimensions while keeping only the original feature. I know this can be done, we covered something very similar in the Advanced class. I will dig out my book and take a look.

                    If I find it, I will post it. Great one to start my morning with Terry!
                    DCCFreak

                    Comment


                    • #11
                      Originally posted by dccfreak
                      I believe it is possible to pass the measured point data from each spere into a subroutine where you would have variablized auto features, then pull that data back into the program utilitizing another subroutine to get what you want. Craiger is correct though about PC-DMIS disposing of the loop dimensions while keeping only the original feature. I know this can be done, we covered something very similar in the Advanced class. I will dig out my book and take a look.

                      If I find it, I will post it. Great one to start my morning with Terry!
                      Oh sure. Actually you could append it to a text file in the loop then outside the loop read it in from the same text file. Then construct what you need. I don't know why I didn't think of that earlier. Then there would be no need for a subroutine. I don't think you can pass variables from PCDMIS to a .bas sub and visa-versa. If you can I really would like for someone to post it because it is something I'd like to do. Hopefully dccfreak can help me with that one.

                      Craig
                      <internet bumper sticker goes here>

                      Comment


                      • #12
                        Originally posted by dccfreak
                        I believe it is possible to pass the measured point data from each spere into a subroutine where you would have variablized auto features, then pull that data back into the program utilitizing another subroutine to get what you want. Craiger is correct though about PC-DMIS disposing of the loop dimensions while keeping only the original feature. I know this can be done, we covered something very similar in the Advanced class. I will dig out my book and take a look.

                        If I find it, I will post it. Great one to start my morning with Terry!
                        Cool, by the by, the points are available outside the loop, just not selectable from a feature window. You can use them to build other features with, dimension them, etc. Glad I could start your day out right!

                        TK
                        sigpicHave a homebrew

                        Comment


                        • #13
                          Well, I looked into my Advanced lab book and found this. Craiger is correct, it would be a matter of writing your loop variables to an ascii file: X,Y,Z,I,J,K for each instance. Then you would need a file read to bring them back into an autosphere by making your autosphere hit values into variables. It is a little bit of work, but, that is all I can come up with for now.
                          DCCFreak

                          Comment


                          • #14
                            Originally posted by dccfreak
                            Well, I looked into my Advanced lab book and found this. Craiger is correct, it would be a matter of writing your loop variables to an ascii file: X,Y,Z,I,J,K for each instance. Then you would need a file read to bring them back into an autosphere by making your autosphere hit values into variables. It is a little bit of work, but, that is all I can come up with for now.
                            OK, I'll look into this when I get a chance.

                            Thanks,

                            TK
                            sigpicHave a homebrew

                            Comment


                            • #15
                              Thanks for the help.

                              I can write the X,Y,X,I,J,K values for the points to a file, and read each individual value back, but how do I reconstruct these into a point that I can then use in the rest of the program?

                              (This is hopefully a simple question, but as a relative newbie, I couldn't find anything useful in the help files)

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X