2d line into 3d rectangle/square

How do I make a 3d rectangle out of 2d line. That is the the height of the rectangle is a constant I define. The top and bottom of the rectangle/square is the length of the line I just drawn?