hexagon logo

Subroutine Features not moving with Alignment

Hi guys, first post here, but I've been scouring the forums for hours trying to find the solution to this one Smiley

I've got a set of features that are common across a slew of different parts, so I've made a subroutine that measures those features and reports the results.

The subroutine has the origin set to the centre of a face, a cylinder, and a line between two circles. The idea is that I get those features on the part, send them into the subroutine, the subroutine aligns the origin to those features and happily measures all the features on the part. This seems very clear and straightforward to me, and when I do the alignment and create a "TESTFACE" generic feature it ends up exactly where I expect it to be.

...But any non-constructed feature doesn't move with the alignment, it stays relative to the origin of the original part. So the two faces "AFACE" and "TESTFACE" are in exactly the same place in the subroutine, and end up in completely different places during execution.

If I force the theoretical of AFACE back to 0,0,0,0,0,1 with ASSIGN/AFACE.TXYZ=MPOINT(0,0,0) the theoretical moves, but the targets still stay in the wrong space. Also this seems like a workaround, but there should be a sensible way to do this.

If I force the targets to stay the same using TARG/<0+0,0+0,0+0>,<0+0,0+0,1+0> then when I take a measurement for the cylinder in the middle the diameter is 800 times what it should be.

I think it's something to do with CAD and PART alignment messiness, and when I tick the "Ignore CAD to Part" in the main program it seems to fix the issue, but I'm concerned about unintended side effects because we always use CAD=PART (even though I know it may not be best practice). I'd like it to ignore just for the subroutine but ticking it there doesn't seem to make a difference.

Please, wise people of the internet, tell me I'm stupid and that I should be doing this completely differently.

Cheers,

Caleb

SUBROUTINE/SF0001,
 AFACEIN = {AFACEIN} : NOMINAL FACE OF THE ROSETTE MOUNT USED FOR ALIGNMENT,
 BCYLIN = {BCYLIN} : NOMINAL CENTRE BORE OF THE ROSETTE MOUNT USED FOR ALIGNMENT,
 CLINEIN = {CLINEIN} : NOMINAL LINE BETWEEN THE TWO PINS USED FOR ALIGNMENT,
 ODENABLED = "TRUE" : WHETHER THE OUTSIDE DIAMETER IS PRESENT ON THE MODEL,
 DIMTAG = 0 : DIMENSION TAG FOR THE WHOLE FEATURE USED FOR REPORTING,
 ACTIVEPROBE = "" : STRING OF THE ACTIVE PROBE FILE FOR CHECKING IT'S CORRECT,
=
IF/!ACTIVEPROBE=="1BY30"
 COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,OVC=NO,
 Wrong probe file loaded for measuring rosette mounts! Please load 1BY30.
END_IF/
ROUGHALIGN =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
 ALIGNMENT/LEVEL,ZPLUS,AFACEIN
 ALIGNMENT/ROTATE,YPLUS,TO,CLINEIN,ABOUT,ZPLUS
 ALIGNMENT/TRANS,XAXIS,BCYLIN
 ALIGNMENT/TRANS,YAXIS,BCYLIN
 ALIGNMENT/TRANS,ZAXIS,AFACEIN
ALIGNMENT/END
PREHIT/1
RETRACT/1
TESTFACE =GENERIC/PLANE,DEPENDENT,CARTESIAN,$
 NOM/XYZ,<0,0,0>,$
 MEAS/XYZ,<0,0,0>,$
 NOM/IJK,<0,0,1>,$
 MEAS/IJK,<0,0,1>
AFACE =FEAT/CONTACT/PLANE/DEFAULT,CARTESIAN,TRIANGLE,LEAST_SQR
 THEO/<0,0,0>,<0,0,1>
 ACTL/<0,0,0>,<0,0,1>
 TARG/<0,0,0>,<0,0,1>
 ANGLE VEC=<1,0,0>,SQUARE
 SHOW FEATURE PARAMETERS=NO
 SHOW CONTACT PARAMETERS=YES
 NUMHITS=2,NUMROWS=2
 SPACER=20
 AVOIDANCE MOVE=BOTH,DISTANCE BEFORE=10,DISTANCE AFTER=10
 SHOW HITS=NO

Parents Reply Children
  • The issue you are describing if I got it right has to do with alignment. It's been a while I last did it but normally I save the manual alignment externally and recall it using an input variable in the subroutine. If high precision is required a good DCC alignment seals the deal after :)
    Try it and let us know if that help you  

  • Thank you for your answer, I'll give that a try as soon as I can!

    I'm not sure it is alignment though, I think I'm doing something else wrong. When I do the alignment in the subroutine the origin and constructed features are definitely where they're supposed to be, but the theoretical for the auto feature don't move with them.

    Basically I don't understand why a feature and a constructed feature that are in the same place before an alignment are in different places after the alignment.