hexagon logo

manipulating arrays question

i'm a noob, so this may be pretty simple for the rest of you. I have a large number of auto-vector hits in this program, what I want is to report the minimum and maximum tol values. I have been reading hte help files and manuals, but I can't figure this out. here is what i have so far:

scn1 = feature set of all the points
loc1234 = dimensioned scn1 tol
assign v1 = sortup(array(loc1234.t.meas))

Or do I have to report all the individual points and then construct an array like this: assign v1 = array(loc1.t.meas, loc2.t.meas.....etc)
if so, is there an easy way to do that?
  • Hope this helps.


    Back to work after a few days off.
    The CODE IN RED needs to be changed to the CODE IN BLUE.

    the constructed feature set needs to input the number of hits.

    Take the CODE IN RED out.
    $$ NO,*****
    $$ NO,***** create t-value for each hit in scn1
    $$ NO,*****
    [COLOR=#ff0000]ASSIGN/VAR1=DOT((SCN1.HIT[1..scn1.numhits].XYZ-SCN1.HIT[1..numhits].TXYZ),SCN1.HIT[1..numhits].TIJK)[/COLOR]
    $$ NO, *****
    [COLOR=#0000ff]ASSIGN/VAR1=DOT((SCN1.HIT[1..17].XYZ-SCN1.HIT[1..17].TXYZ),SCN1.HIT[1..17].TIJK)[/COLOR]
    $$ NO, *****
    $$ NO, ***** calculate profile for scn1
    $$ NO, ***** absolute value of max value - min value
    $$ NO, ***** then set variable to 4 place decimal
    $$ NO, *****
    ASSIGN/MAX_VAR1=MAX(VAR1)
    ASSIGN/MIN_VAR1=MIN(VAR1)
    ASSIGN/VAR2=ABS(MAX_VAR1-MIN_VAR1)
    ASSIGN/PROF_VAR2=FORMAT("%.4f",VAR2)
    COMMENT/REPT, "MAX SCN1 = "+MAX_VAR1
    COMMENT/REPT, "MIN SCN1 = "+MIN_VAR1
    COMMENT/REPT, "PROFILE OF SCN1 ="+PROF_VAR2
    



    Proper syntax is of the utmost importance.Slight smile Arrgghh!

    Or change to:
    ASSIGN/VAR1=DOT((SCN1.HIT[1..scn1.numhits].XYZ-SCN1.HIT[1..scn1.numhits].TXYZ),SCN1.HIT[1..scn1.numhits].TIJK)
  • I'm getting a whole lot of pretty red text. I guess I don't understand what you are doing exactly with these parts: DOT(--FIRST PART--),SCN1.HIT[1..numhits].TIJK) is that a second parameter?? I don't know the DOT() command ????

    The parts I can get to "work" (color blue) return zero.
    I don't understand this stuff.





    DIM LOC1= LOCATION OF POINT P1
    AX MEAS
    T -0.0046
    END OF DIMENSION LOC1
    DIMINFO/LOC1;ICON,DIMID,FEATID,VERT,HORIZ, ,$
    HEADINGS,GRAPH AXIS;TOL, , , , , , , , ,$
    T, , , , , , , , , , , , , , , ,
    DIM LOC2= LOCATION OF POINT P2
    AX MEAS
    T -0.0047
    END OF DIMENSION LOC2
    DIMINFO/LOC2;ICON,DIMID,FEATID,VERT,HORIZ, ,$
    HEADINGS,GRAPH AXIS;TOL, , , , , , , , ,$
    T, , , , , , , , , , , , , , , ,
    DIM LOC3= LOCATION OF POINT P3
    AX MEAS
    T -0.0050
    END OF DIMENSION LOC3
    DIMINFO/LOC3;ICON,DIMID,FEATID,VERT,HORIZ, ,$
    HEADINGS,GRAPH AXIS;TOL, , , , , , , , ,$
    T, , , , , , , , , , , , , , , ,






    ASSIGN/ARY1=ARRAY( LOC1.T.MEAS,LOC2.T.MEAS,LOC3.T.MEAS) ASSIGN/R1=SORTUP(ARY1)






    ASSIGN/MAX_R1=MAX(R1)
    ASSIGN/MIN_R1=MIN(R1)
    COMMENT/REPT,
    "max is "+MAX_R1
    "min is "+MIN_R1




    DIM LOC1= LOCATION OF POINT P1
    AX MEAS
    T -0.0046
    DIM LOC2= LOCATION OF POINT P2
    AX MEAS
    T -0.0047
    DIM LOC3= LOCATION OF POINT P3
    AX MEAS
    T -0.0050
    max is -0.0046
    min is -0.005



    the bold part is what i want to know how to get around (cuz i can't c+P). maybe i wasnt cleatr enough in my question
  • The DOT command is the dot product math function. The formula will create an array of all the t-values.
  • i got the formula to work (turn blue at least), and I think I understand what is going on there... but still reporting zeros.


    T value for all 17 hits in scan one are dimensioned up here

    SCN1 =FEAT/SET,CARTESIAN
    THEO/<-0.0034,-0.0671,1.4152>,<0,0,1>
    ACTL/<-0.0042,-0.0575,1.415>,<0,0,1>
    CONSTR/SET,BASIC,P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,,

    ASSIGN/VAR1=DOT((SCN1.HIT[1..SCN1.NUMHITS].XYZ-SCN1.HIT[1..NUMHITS].TXYZ),SCN1.HIT[1..NUMHITS].TIJK)
    ASSIGN/MAX_VAR1=MAX(VAR1)
    ASSIGN/MIN_VAR1=MIN(VAR1)
    COMMENT/REPT,
    "ORBIT RANGE IS "+MIN_VAR1+" TO "+MAX_VAR1

    report reads : "orbit range is 0 to 0"


    this line will not work: ASSIGN/PROF_VAR2=FORMAT("%.4f",VAR2)
  • Is this your actual code?

    You have P 13


    You should have P13. No space
  • No, there is no space there in the code. I've moved on to a different program now, tried the formula and other code again, and as before it 'works' but still reports zeroes.
  • Maybe have to change numhits to 17. Numhits works for a scanned feature, or measured feature. Maybe not a constructed feature set.sorry.
  • that reports values, but not anything i can use.
    "range is -0.531 to 0.3018"
    the answer in this case should be -0.0091 to -0.0102

    Is this a code method you use yourself, am i missing something, or is maybe this dot product approach not going to work out for what I want to use it for?
  • Maybe you could try to do it with points only, in a loop. DPH51 uses this formula from a long time and it works fine !
    If you try something like :
    ASSIGN/VAR2=""
    ASSIGN/ I=1
    LOOP from 1 to 17
    ASSIGN/VAR1="P"+I
    ASSIGN/VAR2=VAR2+","+DOT(VAR1.XYZ-VAR1.TXYZ,VAR1.TIJK)
    ASSIGN/I=I+1
    End loop
    Then you calculate min and max of Var2.

    I'm not sure of the syntax, I'm not at the CMM now, but I think it should work.
  • Why not just turn on MAX and MIN reporting for the profile tolerance using the dimension format command? (F10 / dimension tab)