The best way to do what you want it to create two elements. First, draw the outline of the rectangle at the dimensions that you want it. Second, draw a circle at the radius of the half-pipe that you want in there. Get the circle located in the rectangle where you want it. The Align Elements - Vert Center command can help get them lined up left to right.
Another way to line them up, if you know how high above the bottom of the rectangle you want the half-pipe, is to move the circle to the center of the bottom line of the rectangle as follows:
Pick Move, snap to the bottom of the circle and accept, then snap to the midpoint of the bottom line of the rectangle, but don't accept. Either use accudraw to specify the verticle offset from the bottom to put the circle, or key-in "DX=0,#", where # is the distance that you want the bottom of the half-pipe above the rectangle.
Now that you have the elements placed correctly, use the trim command twice - first to trim the circle to the top of the rectangle, second to trim the rectangle back to the edges of the circle.
Hope this helps.
Rob