If you want to do something more complex than a simple cylindrical/square shape you can use the sweep modifier on a spline which allows you to specify a second curve as the profile. Also if you want even more control there is a compound object called a loft. This will let you control the orientation of the profile and its…