How to place pipes that are connected to system?

Hi I realized that Script in link was not working - at least for me ?! it is always so annoying

Creating pipe from CAD file

Here is my working version of Script:

Code.txt (1.4 KB)