Put on your safety gear and cut the pipe to the right length using a hacksaw. Afterwards clean up the edges by removing any fragments left over from the sawing.
Put the pipe into the converter and add the elbow. Place the second piece of pipe into the elbow and measure where the solenoid will sit. Before you cut the pipe to size, remember the solenoid and pipe will need to fit under a cover, so take that into account when measuring.