Hi,
Using the Selector Operator driven by an expression should help to "pick" the correct part (XSplineMatID for corners returns the ID of the segment BEFORE the corner and XSplineNextMatID ID of the segment AFTER the corner.):
return if (XSplineMatID==2 && XSplineNextMatID==3, 1, 2)));
I hope that helps.
Best regards,