Thanks for the answer. But this doesn't suit me.

Look, initially we have two solids, these are two beams. We extract rods (beam elements) from them and they become lines. Now that we have created the mesh, they will again look like beams as before the drawing. Now these beams need to be connected behind the walls, how to do this?