FLIP DIMENSION PARAMETER Determination For a Distance Mate

Hello Everyone,

I need help in establishing a simple technique to add distance mates using a reference plane.

The component to be mated has been inserted exactly in the right position in the assembly.

The need is to be able to create a distance mate with an automatic non interactive setting of both the alignment condition as well as the flip dimension setting .

Would like to know if someone has worked out an elegant technique to determine the flipdimension setting based on the location of the component and ref plane

positions.

I would prefer a method that does no post mate analysis because this is just plain time consuming.

More simply stated

How do you determine whether to set the flipdimension boolean to true or false without user interaction.

Component should not move from the current inserted location.

Alignment setting has been determined getting the component face normal and the refplane normal  and comparing them to either align or antialign that

parameter. Distance is basically the distance between these planes.

Unable to get a foolproof method for the flip dimension parameter however.

Set swMate = swAssy.AddMate3(swMateDISTANCE, swMateAlignCLOSEST,FLIPDIMENSION , CurDist, CurDist, CurDist, 0, 0, 0, 0, 0, False, ErrorLong)

Thanks .

Pankaj Bir

SolidworksApi macros