The NRotatedBoundsPort is always anchored to a location, that is relative to the actual shape bounds. This location is specified with X and Y factors of the actual shape bounds. So if you have N ports to place on a shape side, you need to create the ports with step 100 / N+1. (50, 50) is the center of the shape, so the formula for the left side ports is: X=-50, Y=-50 + (I * (100 / N+1)), where N is the number of ports to evenly space on the side and I is the 1 based index of the port to place. If you have two ports their Y percent factors become:
1. -50 + (1 * (100 / (2+1)) = -50 + 33;
1. -50 + (2 * (100 / (2+1)) = -50 + 66;