hexagon logo

Using looping feature for evaluations and to create sets

Hello,

It's been now several years I work with PCDMIS. I've always been able to find answer using this forum of other recourses.
I'm currently stuck with a problem on my program and I would like to know if you guys have advice for me !


The program is a simple measure of multiples thicknesses on a plate.
I want to use a loop to measure those points since there is so many.
I have a hard time using the measured points for:
  1. Create the dimensions (two points distance) : The dimension are not measured correctly
  2. Generate a point cloud that I can export as .XYZ : The point cloud end up empty
I think the methodology itself might be wrong, I would like to know if it's worth continuing that path.
Let me know your opinion.


There is the code, it's split into 3 loop, one to measure one side, the second to measure the other side and the last for the dimensions. Then I save everything into a point cloud.

$$ NO,

** Measure **

MOVE/POINT,NORMAL,<130.69,366.935,-74.414>
TIP/T1A-65B0, SHANKIJK=-0.012, 0.416, -0.909, ANGLE=0

PREHIT/3
RETRACT/3

ASSIGN/HEIGHT=385
ASSIGN/WIDTH=285
ASSIGN/HEIGHT_CLR=15
ASSIGN/WIDTH_CLR=10
ASSIGN/THICK=10.7

ASSIGN/PNT_X=30
ASSIGN/PNT_Y=20
ASSIGN/SPC_X=(WIDTH-20)/PNT_X
ASSIGN/SPC_Y=(HEIGHT-30)/PNT_Y
ASSIGN/CNT_X=0

$$ NO,
* Measure on Y- side*
VX =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
ASSIGN/POSX=10+VX*SPC_X
VY =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
ASSIGN/POSY=10+VY*SPC_Y
PNT_YMINUS =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
THEO/<POSX,POSY,0*1>,<0,0,-1>
ACTL/<274.998,364.991,-0.234>,<0,0,-1>
TARG/<POSX,POSY,0*1>,<0,0,-1>
SNAP=NO
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=NO
LOOP/END
LOOP/END

MOVE/POINT,NORMAL,<153.024,720.129,-64.274>
TIP/T1A60B0, SHANKIJK=0.011, 0.506, 0.862, ANGLE=180
MOVE/POINT,NORMAL,<158.107,596.538,195.345>

$$ NO,
* Measure on Y- side *
VX =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
ASSIGN/POSX=10+VX*SPC_X
VY =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
ASSIGN/POSY=10+VY*SPC_Y
PNT_YPLUS =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
THEO/<POSX,POSY,THICK*1>,<0,0,1>
ACTL/<274.999,364.99,10.977>,<0,0,1>
TARG/<POSX,POSY,THICK*1>,<0,0,1>
SNAP=NO
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=NO
LOOP/END
LOOP/END

MOVE/POINT,NORMAL,<158.107,596.538,195.345>

$$ NO,
* Distance dimension *
VX =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
VY =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
ASSIGN/POSY=10+VY*SPC_Y
DIM DIST= 2D DISTANCE FROM POINT PNT_YPLUS[VX,VY] TO POINT PNT_YMINUS[VX,VY] (CENTER TO CENTER),NO_RADIUS
AX NOMINAL MEAS DEV +TOL -TOL OUTTOL
M 0.000 0.008 0.008 0.025 0.025 0.000
LOOP/END
LOOP/END

$$ NO,
* Create point cloud *
HITS_SET_MINUS=FEAT/SET,CARTESIAN
THEO/<18.833,27.75,0>,<0,0,1>
ACTL/<18.833,27.738,0.139>,<0,0,1>
CONSTR/SET,BASIC,PNT_YMINUS[1..PNT_X,1..PNT_Y],,
HITS_SET_PLUS=FEAT/SET,CARTESIAN
THEO/<18.833,27.75,10.7>,<0,0,1>
ACTL/<18.832,27.738,10.917>,<0,0,1>
CONSTR/SET,BASIC,PNT_YPLUS[1..PNT_X,1..PNT_Y],,
COP =COP/DATA,TOTAL SIZE=2,REDUCED SIZE=2,
FINDNOMS=NO,REF,HITS_SET_PLUS,HITS_SET_MINUS,,
=COP/OPER,Export,FORMAT=XYZ,FILENAME=,SIZE=0
REF,,
COP_EXP =COP/OPER,Export,FORMAT=XYZ,FILENAME=C:\USERS\SCPA006\D ESKTOP\TEST.XYZ,SIZE=0
REF,,


Thanks for your help !
Parents
  • I didn't try anything for the COP, however I may have a way to help with the output for your distance dimensions.

    $$ NO,
    
    ASSIGN/HEIGHT=385
    ASSIGN/WIDTH=285
    ASSIGN/HEIGHT_CLR=15
    ASSIGN/WIDTH_CLR=10
    ASSIGN/THICK=10.7
    $$ NO,
    
    ASSIGN/PNT_X=30
    ASSIGN/PNT_Y=20
    ASSIGN/SPC_X=(WIDTH-20)/PNT_X
    ASSIGN/SPC_Y=(HEIGHT-30)/PNT_Y
    ASSIGN/CNT_X=0
    $$ NO,
    
    VX =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/POSX=10+VX*SPC_X
    VY =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/POSY=10+VY*SPC_Y
    MOVE/POINT,NORMAL,<POSX,POSY,0-0.1>                                              <Added this to force 'shift' in the offline run (probably not needed for online cycles)
    PNT_YMINUS =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<POSX,POSY,0*1>,<0,0,-1>
    ACTL/<98.3333,27.75,0>,<0,0,-1>
    TARG/<POSX,POSY,0*1>,<0,0,-1>
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    LOOP/END
    LOOP/END
    $$ NO,
    
    VX =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/POSX=10+VX*SPC_X
    VY =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/POSY=10+VY*SPC_Y
    MOVE/POINT,NORMAL,<POSX,POSY,THICK+0.1>                                              <Added this to force 'shift' in the offline run (probably not needed for online cycles)
    PNT_YPLUS =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<POSX,POSY,THICK>,<0,0,-1>
    ACTL/<54.1677,98.749,10.703>,<0,0,-1>
    TARG/<POSX,POSY,THICK>,<0,0,-1>
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    LOOP/END
    LOOP/END
    $$ NO,
    
    VX =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    VY =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<PNT_YMINUS[VY,VX].TX,PNT_YMINUS[VY,VX].TY,PNT_YMINUS[VY,VX].TZ>,$
    MEAS/XYZ,<PNT_YMINUS[VY,VX].X,PNT_YMINUS[VY,VX].Y,PNT_YMINUS[VY,VX].Z>,$
    NOM/IJK,<0+0,0+0,0-1>,$
    MEAS/IJK,<0+0,0+0,0-1>
    F2 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<PNT_YPLUS[VY,VX].TX,PNT_YPLUS[VY,VX].TY,PNT_YPLUS[VY,VX].TZ>,$
    MEAS/XYZ,<PNT_YPLUS[VY,VX].X,PNT_YPLUS[VY,VX].Y,PNT_YPLUS[VY,VX].Z>,$
    NOM/IJK,<0+0,0+0,0+1>,$
    MEAS/IJK,<0+0,0+0,0+1>
    WORKPLANE/YPLUS                                                                                                                                    
    DIM DIST2= 2D DISTANCE FROM POINT F1 TO POINT F2 PAR TO ZAXIS,NO_RADIUS UNITS=IN,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
    AX MEAS NOMINAL DEV
    M 10.7050 THICK 0.0050 -------->
    LOOP/END
    LOOP/END
    $$ NO,
    
    


    Instead of inserting the looped feature names into the distance output, pass the values through generic features and set the dimension comparison between those.
Reply
  • I didn't try anything for the COP, however I may have a way to help with the output for your distance dimensions.

    $$ NO,
    
    ASSIGN/HEIGHT=385
    ASSIGN/WIDTH=285
    ASSIGN/HEIGHT_CLR=15
    ASSIGN/WIDTH_CLR=10
    ASSIGN/THICK=10.7
    $$ NO,
    
    ASSIGN/PNT_X=30
    ASSIGN/PNT_Y=20
    ASSIGN/SPC_X=(WIDTH-20)/PNT_X
    ASSIGN/SPC_Y=(HEIGHT-30)/PNT_Y
    ASSIGN/CNT_X=0
    $$ NO,
    
    VX =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/POSX=10+VX*SPC_X
    VY =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/POSY=10+VY*SPC_Y
    MOVE/POINT,NORMAL,<POSX,POSY,0-0.1>                                              <Added this to force 'shift' in the offline run (probably not needed for online cycles)
    PNT_YMINUS =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<POSX,POSY,0*1>,<0,0,-1>
    ACTL/<98.3333,27.75,0>,<0,0,-1>
    TARG/<POSX,POSY,0*1>,<0,0,-1>
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    LOOP/END
    LOOP/END
    $$ NO,
    
    VX =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/POSX=10+VX*SPC_X
    VY =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    ASSIGN/POSY=10+VY*SPC_Y
    MOVE/POINT,NORMAL,<POSX,POSY,THICK+0.1>                                              <Added this to force 'shift' in the offline run (probably not needed for online cycles)
    PNT_YPLUS =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
    THEO/<POSX,POSY,THICK>,<0,0,-1>
    ACTL/<54.1677,98.749,10.703>,<0,0,-1>
    TARG/<POSX,POSY,THICK>,<0,0,-1>
    SHOW FEATURE PARAMETERS=NO
    SHOW CONTACT PARAMETERS=NO
    LOOP/END
    LOOP/END
    $$ NO,
    
    VX =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    VY =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<PNT_YMINUS[VY,VX].TX,PNT_YMINUS[VY,VX].TY,PNT_YMINUS[VY,VX].TZ>,$
    MEAS/XYZ,<PNT_YMINUS[VY,VX].X,PNT_YMINUS[VY,VX].Y,PNT_YMINUS[VY,VX].Z>,$
    NOM/IJK,<0+0,0+0,0-1>,$
    MEAS/IJK,<0+0,0+0,0-1>
    F2 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<PNT_YPLUS[VY,VX].TX,PNT_YPLUS[VY,VX].TY,PNT_YPLUS[VY,VX].TZ>,$
    MEAS/XYZ,<PNT_YPLUS[VY,VX].X,PNT_YPLUS[VY,VX].Y,PNT_YPLUS[VY,VX].Z>,$
    NOM/IJK,<0+0,0+0,0+1>,$
    MEAS/IJK,<0+0,0+0,0+1>
    WORKPLANE/YPLUS                                                                                                                                    
    DIM DIST2= 2D DISTANCE FROM POINT F1 TO POINT F2 PAR TO ZAXIS,NO_RADIUS UNITS=IN,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
    AX MEAS NOMINAL DEV
    M 10.7050 THICK 0.0050 -------->
    LOOP/END
    LOOP/END
    $$ NO,
    
    


    Instead of inserting the looped feature names into the distance output, pass the values through generic features and set the dimension comparison between those.
Children
No Data