Hi,
Using the Selector Operator driven by the following expression will do the job (XSplineMatID for corners returns the ID of the segment BEFORE the corner and XSplineNextMatID ID of the segment AFTER the corner.):
return if (XSplineMatID==1 && XSplineNextMatID==1,1,if(XSplineMatID==1 && XSplineNextMatID==2,2,if(XSplineMatID==2 && XSplineNextMatID==1,3,4)));
I hope that helps.
Best regards,