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
  • hello there,

    you can write the xyz data direct to an textfile
    either directly in the loop with the measuring points or later in an extra loop

    (maybe a bit faster than the detour via pointcloud)


    FPTR =FILE/OPEN,C:\USERS\QS\DESKTOP\TEST.TXT,WRITE
    VX_OUTPUT =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    VY_OUTPUT =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    FILE/WRITELINE,FPTR,STR(PNT_YMINUS[VX_OUTPUT,VY_OUTPUT].XYZ)
    LOOP/END
    LOOP/END



    the formating is maybe off
    if this solution is something for you, then the format can be fixed with some string commands


    bye
Reply
  • hello there,

    you can write the xyz data direct to an textfile
    either directly in the loop with the measuring points or later in an extra loop

    (maybe a bit faster than the detour via pointcloud)


    FPTR =FILE/OPEN,C:\USERS\QS\DESKTOP\TEST.TXT,WRITE
    VX_OUTPUT =LOOP/START,ID=YES,NUMBER=PNT_X,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    VY_OUTPUT =LOOP/START,ID=YES,NUMBER=PNT_Y,START=1,SKIP=,
    OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
    FILE/WRITELINE,FPTR,STR(PNT_YMINUS[VX_OUTPUT,VY_OUTPUT].XYZ)
    LOOP/END
    LOOP/END



    the formating is maybe off
    if this solution is something for you, then the format can be fixed with some string commands


    bye
Children
No Data