High Point Extraction ?

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

  • High Point Extraction ?

    I'm trying to find the high point of this scan. I'm using 4.1. Is there something I'm missing? I am only getting the first number out of the scan. Or nothing at all. Also need to know if this will work if the number is either plus or minus. And still get the high point. Any help would be great.

    Thanks.






    SCN1 =BASICSCAN/LINE,SHOWHITS=YES,SHOWALLPARAMS=YES
    -0.3247,-4.6525,-0.05,-0.1679,-4.6525,-0.0813,CutVec=-0.0013363,0.9996233,-0.0274135,DirVec=0.9207487,0.0119255,0.3899738
    InitVec=-0.9999991,-0.0013278,0.0003289,EndVec=0.00078,0.0274146,0.999 6238,THICKNESS=0,PROBECOMP=YES,AUTO MOVE=NO,DISTANCE=0
    FILTER/DISTANCE,0.008
    EXEC MODE=RELEARN
    BOUNDARY/PLANE,-0.1679,-4.6525,-0.0813,PlaneVec=-0.9999988,-0.0013144,0.0008163,Crossings=1
    HITTYPE/VECTOR
    NOMS MODE=MASTER
    HIT/VECTOR,-0.3457,-4.6534,-0.0811,-0.6354987,0.0203171,0.7718346,-0.3457,-4.6524,-0.0811,T=0
    HIT/VECTOR,-0.3394,-4.6532,-0.0753,-0.7304669,0.0177462,0.6827175,-0.3394,-4.651,-0.0753,T=0
    HIT/VECTOR,-0.332,-4.6529,-0.0659,-0.7921526,0.0156729,0.6101217,-0.332,-4.6518,-0.0659,T=0
    HIT/VECTOR,-0.329,-4.6528,-0.0626,-0.7354594,0.0175921,0.6773403,-0.329,-4.6513,-0.0626,T=0
    HIT/VECTOR,-0.3246,-4.6527,-0.0579,-0.7090264,0.0183844,0.7049422,-0.3246,-4.6512,-0.0579,T=0
    HIT/VECTOR,-0.32,-4.6526,-0.0536,-0.6768301,0.019276,0.7358868,-0.32,-4.6511,-0.0536,T=0
    HIT/VECTOR,-0.3155,-4.6525,-0.0496,-0.6366195,0.0202903,0.7709111,-0.3155,-4.6509,-0.0496,T=0
    HIT/VECTOR,-0.311,-4.6524,-0.0461,-0.5881967,0.0213841,0.8084352,-0.311,-4.6508,-0.0461,T=0
    HIT/VECTOR,-0.3059,-4.6523,-0.0426,-0.5491768,0.0221761,0.8354119,-0.3059,-4.6507,-0.0426,T=0
    HIT/VECTOR,-0.3005,-4.6522,-0.0392,-0.5085534,0.0229246,0.8607252,-0.3005,-4.6506,-0.0392,T=0
    HIT/VECTOR,-0.2955,-4.6521,-0.0365,-0.4479022,0.0239117,0.8937628,-0.2955,-4.6505,-0.0365,T=0
    HIT/VECTOR,-0.2911,-4.652,-0.0345,-0.3692926,0.0249825,0.9289773,-0.2911,-4.6504,-0.0345,T=0
    HIT/VECTOR,-0.2861,-4.652,-0.0328,-0.2908984,0.0258394,0.956405,-0.2861,-4.6505,-0.0328,T=0
    HIT/VECTOR,-0.2812,-4.6519,-0.0315,-0.208945,0.0265294,0.9775675,-0.2812,-4.6504,-0.0315,T=0
    HIT/VECTOR,-0.2764,-4.6519,-0.0307,-0.1169689,0.0270691,0.9927666,-0.2764,-4.6507,-0.0307,T=0
    HIT/VECTOR,-0.2719,-4.6519,-0.0304,-0.0119247,0.0273957,0.9995535,-0.2719,-4.6506,-0.0304,T=0
    HIT/VECTOR,-0.2673,-4.6519,-0.0306,0.0925642,0.0274195,0.9953291,-0.2673,-4.6506,-0.1306,T=0
    HIT/VECTOR,-0.2616,-4.6519,-0.0313,0.1717241,0.0272357,0.9847685,-0.2616,-4.6507,-0.0313,T=0
    HIT/VECTOR,-0.2542,-4.6519,-0.033,0.1979173,0.0271357,0.979843,-0.2542,-4.6508,-0.033,T=0
    HIT/VECTOR,-0.2471,-4.652,-0.0342,0.2382788,0.0269423,0.970823,-0.2471,-4.6508,-0.0342,T=0
    HIT/VECTOR,-0.2416,-4.652,-0.0359,0.3151723,0.0264374,0.9486662,-0.2416,-4.6509,-0.0359,T=0
    HIT/VECTOR,-0.2361,-4.6521,-0.038,0.3861883,0.0258027,0.922059,-0.2361,-4.6509,-0.038,T=0
    HIT/VECTOR,-0.2304,-4.6521,-0.0407,0.4484008,0.0251021,0.8934801,-0.2304,-4.651,-0.0407,T=0
    HIT/VECTOR,-0.2252,-4.6522,-0.0434,0.5147351,0.0241906,0.8570079,-0.2252,-4.651,-0.0434,T=0
    HIT/VECTOR,-0.2208,-4.6523,-0.0464,0.5973537,0.022783,0.8016542,-0.2208,-4.6511,-0.0464,T=0
    HIT/VECTOR,-0.2168,-4.6523,-0.0497,0.6758871,0.0211068,0.7367029,-0.2168,-4.6512,-0.0497,T=0
    HIT/VECTOR,-0.2132,-4.6524,-0.0533,0.7473452,0.0192129,0.6641581,-0.2132,-4.6513,-0.0533,T=0
    HIT/VECTOR,-0.2098,-4.6526,-0.0577,0.8068025,0.0172742,0.5905686,-0.2098,-4.6514,-0.0577,T=0
    HIT/VECTOR,-0.2073,-4.6527,-0.0612,0.8767197,0.0143571,0.4807874,-0.2073,-4.6515,-0.0612,T=0
    HIT/VECTOR,-0.2062,-4.6527,-0.0636,0.9456739,0.0101758,0.3249575,-0.2062,-4.6516,-0.0636,T=0
    ENDSCAN

    ASSIGN/NHITS = SCN1.NUMHITS
    ASSIGN/C = 1
    ASSIGN/MAXVAL = 1
    DO/
    ASSIGN/MYVAL = SCN1.HIT[C].Z
    IF/MYVAL>MAXVAL
    ASSIGN/MAXVAL = MYVAL
    ASSIGN/HITN = C
    END_IF/
    ASSIGN/C = C+1
    UNTIL/C==NHITS

    F1 =GENERIC/POINT,DEPENDENT,RECT,$
    NOM/XYZ,SCN1.HIT[HITN].TX,SCN1.HIT[HITN].TY,SCN1.HIT[HITN].TZ,$
    MEAS/XYZ,SCN1.HIT[HITN].X,SCN1.HIT[HITN].Y,SCN1.HIT[HITN].Z,$
    NOM/IJK,0,0,1,$
    MEAS/IJK,0,0,1
    Last edited by drako28; 11-30-2006, 09:30 AM.
    PCDMIS CAD++ v4.2mr1
    PCDMIS Pro v4.1

  • #2
    Wouldn't you want your first MAXVAL declaration to equal 0? If not then any hit with a measured value of less than 1 will fail your conditional statement where you evaluate MYVAL > MAXVAL. For positive or negative it will evaluate the number as is so using zero would not work for esclusively negative numbers. I'll need to look at it and think about it a bit.
    Last edited by craiger_ny; 11-30-2006, 09:04 AM.
    <internet bumper sticker goes here>

    Comment


    • #3
      Maxval

      Your Z values are all less than '1' which is your initial Max Value. Set your initial MaxVal to -9999

      Comment


      • #4
        WDS use a reduculously negative number.
        <internet bumper sticker goes here>

        Comment


        • #5
          Thanks for the help guy's. Still having the same problem. It's only reporting the first scan point.
          PCDMIS CAD++ v4.2mr1
          PCDMIS Pro v4.1

          Comment


          • #6
            try some debug

            I don't have a scan handy to try this out right now, but whenever this sort of thing happens to me, I throw in some debug to see what is happening inside. For example -


            ASSIGN/NHITS = SCN1.NUMHITS
            ASSIGN/C = 1
            ASSIGN/MAXVAL = 1
            DO/
            ASSIGN/MYVAL = SCN1.HIT[C].Z

            Comment/Oper, Myval
            Comment/Oper, Maxval
            Comment/Oper, C

            IF/MYVAL>MAXVAL
            ASSIGN/MAXVAL = MYVAL
            ASSIGN/HITN = C
            END_IF/
            ASSIGN/C = C+1
            UNTIL/C==NHITS



            This will help determine that the values you intend are actually being used or not. Perhaps it is using a wrong value somewhere?

            Comment


            • #7
              works for me

              I was on hold, so I made a scan off-line and tried your code. It worked for me.

              Compare mine -

              ASSIGN/NHITS = SCN1.NUMHITS
              ASSIGN/C = 1
              ASSIGN/MAXVAL = -9999
              DO/
              ASSIGN/MYVAL = SCN1.HIT[C].Z
              IF/MYVAL>MAXVAL
              ASSIGN/MAXVAL = MYVAL
              ASSIGN/HITN = C
              END_IF/
              ASSIGN/C = C+1
              UNTIL/C==NHITS
              COMMENT/OPER,NO,MAXVAL
              COMMENT/OPER,NO,C

              to yours and see if there is any syntax difference. I could not see any. Sometimes, I found that if the debug test (mentioned earlier) does not display the proper values, you may only need to re-type the variable name to force it to re-think it.

              Comment


              • #8
                I mentioned in a PM too that sometimes PCDMIS does not recognize variables. If the syntax matches he might want to try retyping in his variable names or renaming especially the variable C. Sometimes for whatever reason it will see them and sometimes not it's a sure thing that it sees it when you type it in and PCDMIS asks if what you typed is a reference to a variable. Thanks for the debug I was going to do that when I had a chance I had a feeling it would work. Perhaps he could insert comments with each variable referenced to see which ones return what.

                Craig
                <internet bumper sticker goes here>

                Comment


                • #9
                  Why do you do this step:
                  ASSIGN/MYVAL = SCN1.HIT[C].Z
                  instead of just comparing directly?
                  Links to my utilities for PCDMIS

                  Comment


                  • #10
                    How do you compare directly?
                    PCDMIS CAD++ v4.2mr1
                    PCDMIS Pro v4.1

                    Comment


                    • #11
                      Instead of this:
                      ASSIGN/MYVAL = SCN1.HIT[C].Z
                      IF/MYVAL>MAXVAL
                      ASSIGN/MAXVAL = MYVAL

                      can you do this:
                      IF/SCN1.HIT[C].Z>MAXVAL
                      ASSIGN/MAXVAL = SCN1.HIT[C].Z
                      Links to my utilities for PCDMIS

                      Comment


                      • #12
                        Worked great. My problem is now when I try making a generic point. It's only reporting the first scan point of the scan. Not the one I need.
                        PCDMIS CAD++ v4.2mr1
                        PCDMIS Pro v4.1

                        Comment


                        • #13
                          Try using the variable you assigned the max value to inside the generic feature instead of the varaible with the hit number, that will simplify it. I may not be understanding exactly what needs to be reported though, just the max hit value or is this where you need all of the info regarding that hit?

                          Craig
                          <internet bumper sticker goes here>

                          Comment


                          • #14
                            I need all the info regarding that hit.
                            PCDMIS CAD++ v4.2mr1
                            PCDMIS Pro v4.1

                            Comment


                            • #15
                              If you put HITN in a comment what does it return (you might be able to mouse hover too)?
                              <internet bumper sticker goes here>

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X