hexagon logo

T-Values from a SCN Set

Ex. SCN1 (either a constructed set or scan feature)

T-Value Calculation and reporting of Max and Min Values.


No generic points needed.

No Loop.

No previous Dimensioning.

Create a T-Value array, find maxval and minval, and get the maxpnt and minpnt.


ASSIGN/TVAL=0

ASSIGN/TVAL=DOT((SCN1.HIT[1..SCN1.NUMHITS].XYZ-SCN1.HIT
[[COLOR=#ff0000]1..SCN1.NUMHITS[/COLOR] ].TXYZ),SCN1.HIT[[/COLOR]1..SCN1.NUMHITS].TIJK)

ASSIGN/MAXVAL=MAXINDEX(TVAL)

ASSIGN/MINVAL=MININDEX(TVAL)

ASSIGN/MAXPNT=GETTEXT("REFERENCE ID",MAXVAL,{SCN1})

ASSIGN/MINPNT=GETTEXT("REFERENCE ID",MINVAL,{SCN1})


Then dimension any two points x,y,z,t
Say LOC1 PNT1 & LOC2 PNT2

Highlight LOC1 and replace it with MAXTVAL
Highlight PNT1 and replace it with MAXPNT

Highlight LOC2 and replace it with MINTVAL
Highlight PNT2 and replace it with MINPNT


That's it.
  • SCN1       =FEAT/SET,CARTESIAN
                THEO/<-4.9989,0.19,2.2362>,<0,-1,0>
                ACTL/<-5.0024,0.1715,2.2356>,<0,0,-1>
                CONSTR/SET,BASIC,PT401,PT402,PT403,PT404,PT405,PT406,PT407,PT408,PT409,PT4010,PT4011,PT4012,PT4013,PT4014,PT4015,PT4016,PT4017,PT4018,PT4019,PT4020,PT4021,PT4022,PT4023,PT4024,PT4025,PT4026,PT4027,,
                ASSIGN/TVAL=0
                ASSIGN/TVAL=DOT((SCN1.HIT[1..SCN1.NUMHITS].XYZ-SCN1.HIT[1.NUMHITS].TXYZ),SCN1.HIT[1.NUMHITS].TIJK)
                ASSIGN/MAXVAL=MAXINDEX (TVAL)
                ASSIGN/MINVAL=MININDEX (TVAL)
                ASSIGN/MAXPNT=GETTEXT("REFERENCE ID",MAXVAL,{SCN1})
                ASSIGN/MINPNT=GETTEXT("REFERENCE ID",MINVAL,{SCN1})
    DIM MAXTVAL= LOCATION OF POINT MAXPNT  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL        MAX        MIN
    X       0.1350     0.0100     0.0100     0.1291    -0.0059     0.0000     0.1291     0.1291 -#----
    Y       0.1900     0.0020     0.0020     0.1812    -0.0088     0.0068     0.1812     0.1812 <-----
    Z       4.0333     0.0020     0.0020     4.0333     0.0000     0.0000     4.0333     4.0333 ---#--
    T       0.0000     0.0020     0.0020    -0.0059    -0.0059     0.0039    -0.0059    -0.0059 <-----
    END OF DIMENSION MAXTVAL
    DIM MINTVAL= LOCATION OF POINT MINPNT  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL        MAX        MIN
    X       0.1350     0.0100     0.0100     0.1291    -0.0059     0.0000     0.1291     0.1291 -#----
    Y       0.1900     0.0020     0.0020     0.1812    -0.0088     0.0068     0.1812     0.1812 <-----
    Z       4.0333     0.0020     0.0020     4.0333     0.0000     0.0000     4.0333     4.0333 ---#--
    T       0.0000     0.0020     0.0020    -0.0059    -0.0059     0.0039    -0.0059    -0.0059 <-----
    END OF DIMENSION MINTVAL
    


    I was trying this out but I seem to be getting the same for both min and max.
    Have any idea what is going wrong?
  • For the TVAL=DOT line all its giving is 0s

    The MAXVAL and MINVAL are 1

    The MAXPNT and MINPNT are PNT401
  • With the correction it works for me with a set constructed from named points.

    When I first tried on a scan (linear open), the two dimensions were red (no name in MAXPNT, MINPNT).
  • No biggie the error was found and now its working, thank you for the code Slight smile
  • Hello there dph51
    I've tried to use your code, as it solves an out put problem I have, but I can't get a result.
    Placing the pointer over the lines just gets a 0 or shows the line of code with no result.
    I've checked the code over & over, may be I've missed something as my eyes are starting to blur.  PLN4 =FEAT/PLANE,RECT
    THEO/-0.185,0,0,0,0,1
    ACTL/0.377,0,-0.028,-0.0007979,0.000672,0.9999995
    CONSTR/PLANE,BF,SCN1,,
    ASSIGN/TVAL = 0
    ASSIGN/TVAL = DOT((SCN1.HIT[1..SCN1.NUMHITS].XYZ-SCN1.HIT[1..SCN1.NUMHITS].TXYZ),SCN1.HIT[1..SCN1.NUMHITS].TIJK)
    ASSIGN/MAXVAL = MAXINDEX(TVAL)
    ASSIGN/MINVAL = MININDEX(TVAL)
    ASSIGN/MAXPNT = GETTEXT("REFERENCE ID",MAXVAL,{SCN1})
    ASSIGN/MINPNT = GETTEXT("REFERENCE ID",MINVAL,{SCN1=)
    DIM MAXTVAL= LOCATION OF MAXPNT UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=1.00 OUTPUT=BOTH
    AX NOMINAL MEAS DEV +TOL -TOL MAX MIN
    X 26.182 26.182 0.000 0.015 0.015 26.182 26.182 ----#----
    Y -59.635 -59.635 0.000 0.015 0.015 -59.635 -59.635 ----#----
    Z 0.000 -0.157 -0.157 0.015 0.015 -0.157 -0.157 <--------
    T 0.000 -0.157 -0.157 0.015 0.015 -0.157 -0.157 <--------
    END OF DIMENSION MAXTVAL
    DIM MINTVAL= LOCATION OF POINT MINPNT UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=1.00 OUTPUT=BOTH
    AX NOMINAL MEAS DEV +TOL -TOL MAX MIN
    X 26.182 26.182 0.000 0.015 0.015 26.182 26.182 ----#----
    Y 59.635 59.635 0.000 0.015 0.015 59.635 59.635 ----#----
    Z 0.000 -0.241 -0.241 0.015 0.015 -0.241 -0.241 <--------
    T 0.000 -0.241 -0.241 0.015 0.015 -0.241 -0.241 <--------
    END OF DIMENSION MINTVAL
    DIM PLAT1= FLATNESS OF PLANE PLN4 UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
    AX NOMINAL MEAS DEV +TOL -TOL MAX MIN
    M 0.000 0.511 0.511 0.010 0.000 0.222 -0.289 -------->




    As you can see I'm working with an old version of DMIS and have never got [1..SCN1.NUMHITS] to work.
    Hopefully a set of expert eyes can see what's wrong. ( I know I'm working in foreign Rolling eyes )
    I thought it could be a language translation thing, I'm working in French as well, but turning back to English changes nothing.

    Any help would be greatly appreciated.
    I'd like to add a big thanks to all here for their help although I don't come here offtenBlush
  • You have a type error in the posted code, see dph51's answer. If you can't get the ..NUMHITS to work, try hardcode the amount of hits used, like [1..213].
  • Oupps, hit the wrong key Blush.
    Corrected and tested but still the same result.
    It has to be something simple I just can't see what.
    All I get is either 0 or "" as result and I think the point results are those of the original points I used, the measured values are 0.001 mm different.
    Oh well it's 1 hour to "Foxtrot Oscar" time.

    Bon Weekend
  • Hi Seul anglais !
    I think you can try 2 solutions :

    1st : create 2 generic points with SCN1.HIT[MINVAL].X , SCN1.HIT[MINVAL].Y,SCN1.HIT[MINVAL].Z as measured values (TX,TY and TZ as theo), the same with IJK for the vector, and the same with MAXVAL for the 2nd point.
    The advantage of DPH's solution goes down (don't have to create points !), but it should work (It was the old way to find those points !)

    2nd : you should change the display of assignments (right click / display values or .... at the bottom of the window), because, if you work in another language than english, I'm not sure that "someone" translated function names (I saw it in an assignment between ""), so that "Reference ID" could be named by NOM ID or something else...

    Hope this help !

    Are you still the "seul anglais "?

    Bon week-end aussi !