Joining Columns of same families

I have created a script in which I am placing columns automatically along a path and placing them automatically.
This is not My problem my problem is that How Can I join Column that are on the same place but with different Levels .
For Example I have a rectangular Column From level 1 to Level 2 , Then on the exact same place I have a Column from level 2 to Level 3
My question is how Can I join these elements in a way that they are directly from Level 1 to Level 3