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.
  • Thank's JEFMAN
    I've had to come off that job for now as there are "more urgent" things to measure Rolling eyes.
    I'll get back to that during the week and give your suggestions a try.
    I did try a few different names/words but no change. Just out of interest what's the use of "DOT", would that be POINT or PNT?

    There has always been 2 other Anglais (mais ils sont les Chefs, doncWink)
  • Dot is the name of the dot product ("produit scalaire"), and it's fortunately not translated.
    The problem of translation appears when the name is between "".
    I had this problem in a gettext or getcommand with "LoadProbe" which was translated by "Charger palpeur".
    The problem for those translations is that the program doesn't work if you change of language, ,because the name is seen as a string (here, an unknown string !).
    If it's the case in Dph code, you have to try to run the prog in english, or try to search what's the translation of " Reference ID" (more exactly how the person who translate decides to translate it !!!!!!!)

    An enhancement should be to translate only functions, and not strings...

    Good luck with "les nouveaux anglais" !
  • ...or get the command value instead of the textual representation (which is languagedependent) where as the command value never changes.

    You can retrieve the command value by choosing what the tooltip should display when hovering over a command (do this in the rightclick menu in the command window).
  • Good point! I had written the same, but forgot to click Post...
  • Hi everyone,
    nice code, i wonder how to extrude the point (after entering the code we know that the maximum T-Val point is assigned to e.g. scan point 215 ). How to show it graphically / how to draw this point in the program
  • I try to extract point like below (not working)

    PRZYPORZ/TVAL=0
    PRZYPORZ/TVAL=DOT((SKAN1.HIT[1..SKAN1.NUMHITS].XYZ-SKAN1.HIT[1..SKAN1.NUMHITS].TXYZ),SKAN1.HIT[1..SKAN1.NUMHITS].TIJK)
    PRZYPORZ/MAXV=MAXINDEX(TVAL)
    PRZYPORZ/MINV=MININDEX(TVAL)

    #max point from the scan (TVAL)
    PNT_SCN_MAX=OGÓLNY/PUNKT,ZALEŻNY,KARTEZJAŃSKI,$
    NOM/XYZ,<MAXV.TX,MAXV.TY,MAXV.TZ>,$
    ZAOBS/XYZ,<MAXV.X,MAXV.Y,MAXV.Z>,$
    NOM/IJK,<MAXV.TI,MAXV.TJ,MAXV.TK>,$
    ZAOBS/IJK,<MAXV.I,MAXV.J,MAXV.K>
  • ASSIGN/MAXPNT=GETTEXT("Reference ID", MAXVAL, {SCN1})
    ^ Tomasz you need this line so you can obtain the NAME of the feature(s)
  • Thanks Slight smile i will check the code tomorrow and let you know how it went Slight smile
  • hi

    if you got the point index,
    you can call it to an constructed point

    LIN1 =FEAT/CONTACT/LINE/DEFAULT,CARTESIAN,BOUNDED
    THEO/<0,-59.019,-115.831>,<0,-238.198,63.348>,<0,-0.7071068,0.7071068>,<0,0.7071068,0.7071068>,<1,0, 0>,253.397
    ACTL/<0,-59.019,-115.831>,<0,-238.198,63.348>,<0,-0.7071068,0.7071068>,<0,0.7071068,0.7071068>,<1,0, 0>,253.397
    TARG/<0,-59.019,-115.831>,<0,-238.198,63.348>,<0,-0.7071068,0.7071068>,<0,0.7071068,0.7071068>,<1,0, 0>
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    
    ASSIGN/TVAL=DOT((LIN1.HIT[1..LIN1.NUMHITS].XYZ-LIN1.HIT[1..LIN1.NUMHITS].TXYZ),LIN1.HIT[1..LIN1.NUMHITS].TIJK)
    ASSIGN/MAXV=MAXINDEX(TVAL)
    ASSIGN/MINV=MININDEX(TVAL)
    
    "constructed point Max"
    MAXPOINT =FEAT/POINT,CARTESIAN,NO
    THEO/<0,-173.369,-1.481>,<0,0.7071068,0.7071068>
    ACTL/<0,-173.369,-1.481>,<0,0.7071068,0.7071068>
    CONSTR/POINT,CAST,LIN1.HIT[MAXV]
    
    "constructed point Min"
    MINPOINT =FEAT/POINT,CARTESIAN,NO
    THEO/<0,-166.166,-8.684>,<0,0.7071068,0.7071068>
    ACTL/<0,-166.166,-8.684>,<0,0.7071068,0.7071068>
    CONSTR/POINT,CAST,LIN1.HIT[MINV]
    
  • I tried to do it the way you described, unfortunately it does not work properly

    
    SCN1       =FEAT/SET,CARTESIAN
                THEO/<5,5,0>,<0,0,1>
                ACTL/<261.658,455.244,-713.558>,<0,0,1>
                CONSTR/SET,BASIC,PKT1,PKT2,PKT3,PKT4,,
                ASSIGN/TVAL=DOT((SCN1.HIT[1..SCN1.NUMHITS].XYZ-SCN1.HIT[1..SCN1.NUMHITS].TXYZ),SCN1.HIT[1..SCN1.NUMHITS].TIJK)
                ASSIGN/MAXV=MAXINDEX(TVAL)
                ASSIGN/MINV=MININDEX(TVAL)
    PKT5       =FEAT/POINT,CARTESIAN,NO
                THEO/<0,0,0>,<0,0,1>
                ACTL/<0,0,0>,<0,0,1>
                CONSTR/POINT,CAST,SCN1.HIT[MAXV]