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?
  • The logic of that approach is much easier for my simple mind to comprehend. still reports only the value of the last point in the loop, though. Tried it with some changes but only reports zero. I have a lot to learn here. Maybe I'll go do some reading for awhile. Thanks for all the help, I do appreciate it very much.
  • profiling sets of data points are not as useful to my purposes as they are for the majority of cmm programmers. I have a more specialized type of inspection duty where I work. Not at all like a foundry or job shop, mostly carbon electrodes, so the most efficient method is to create a point cloud over the geometry and review the the T values for each point in a list. sometimes I'm still taking a couple hundred points, and being an idiot i've never been able to figure out better reporting technique.
  • Not exactly min and max, but you can try Insert -> Report command -> Pointinfo, select all the points and set a filter to show just the worst of them. Or all points over a certain deviation, or... (there are lots of variations).

    With the right settings, this can almost produce a 'color map' over the part.
  • Try like that, I hope it will be ok...
    ASSIGN/VAR2="("+VAR2+","+DOT(VAR1.XYZ-VAR1.TXYZ,VAR1.TIJK)+")"
  • Interesting approach jefman, but all I got was "(0,0)" on report.

    I've tried a bunch of different variations of the code and I can't get anything but zeros to report. The only way I've been successfully able to creat an array of the measured tolerance values and report them is by typing in all the LOC#'s manually into the array, like this ASSIGN/ V1 = ARRAY(LOC1.T.MEAS, LOC2.T.MEAS, etc....), then sort up and report min as v1.1 and max as v1.(# of last hit). Which I never am going to take the time to set up something like that because it negates the convenience of getting the two values i want from the array. 99% of the time when I'm inspecting graphite electrodes I just need to know if they're in-tolerance, so max and min tolerance numbers are what I want, and when reviewing 150 (or more) individual points' tol values there's a greater chance an "oopsie" will slip through and down the line (where it becomes a BIG, exponentially more costly oopsie).

    I have been trying different ways of getting those "LOC#.T.MEAS" values to generate in an array with looping but with no success yet. I AM going to figure this out one day....then I'll be a demon-slayer.
  • I can't try it for the instant (I'm not at the CMM), so I try to help you only with my little memory !
    You could try to assign the array after the loop, something like in the loop VAR2=DOT(VAR1.XYZ-VAR1.TXYZ,VAR1.TIJK), and after the loop ASSIGN/VAR3=VAR2[1..17] ?
  • I don't understand why you don't view the max/min profile reporting of a set constructed from all the points as a solution. It's quick and easy, and it does what you need. I like easy. And, you don't have to worry about a bug in your custom code.

    If you really feel the need to write code to do this see here: http://www.PCDMISForum.com/showthread.php?p=336214, post #5. This code does exactly what you are looking for.
  • 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..scn1.numhits].XYZ-SCN1.HIT[1..scn1.numhits].TXYZ),SCN1.HIT[1..scn1.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
    
  • Why not just turn on MAX and MIN reporting for the profile tolerance using the dimension format command? (F10 / dimension tab)


    +1

    Returns the same max/min t-values as my code.
  • dph51 is smart, i am dumb. dph51 is cool, i am a loser. dph51 is attractive, i am less attractive. dph51 is good at coding, i am not.
    I don't understand why the part scn1.hit[1..17] works and "scn1.hit[1..numhits", "scn1.hit[1..scn1.17]", and any other variation doesn't. seems a little strange to me.

    DJAMS - as for the min/max profile reporting... i got "max = -0.0025, min = -0.0125" on the report using your method, where the actual max/min is -0.0152 to -0.0163 (which is what i got with dph51's code). why, i don't know, but it isn't useful to me.