Yes. Conventionally the core concentrates field lines generated by the coil wrapped around it. The return path is through the air, so field lines extend a considerable distance from the core allowing it to attract ferromagnetic objects. In your geometry, the return path of lines from the pipe is through the center of the coil. The field falls away rapidly with distance, making it basically suitable only for sticking to a thin plate. A simliar geometry is used for permanent magnets intended to stick onto sheet metal--magnets in the base of removable car radio antennas, e.g.