# Multiple Pipe Networks from Multiple Polylines

**URL:** <https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455>\
**Category:** Civil 3D\
**Created:** [November 16, 2021, 11:47pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455 "2021-11-16T23:47:32Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jMrkz5280](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jMrkz5280](https://forum.dynamobim.com/u/jMrkz5280)\
**Post date:** [November 16, 2021, 11:47pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/1 "2021-11-16T23:47:32Z")

</div>

Hello,  
I am trying to create a dynamo script to automate the creation of pipe networks. Our company is a standard that we generate pipe networks for our dry utilities regardless of their SUE status. We typically show dry utilities 2.5 feet below existing ground until we confirm the exact location. Our typical workflow is as follows.

1. Copy polylines from the existing utility file
2. Create alignments
3. Create existing ground profiles
4. Generate profile views
5. Generate pipe networks from polylines
6. Project pipe networks to profile views
7. Adjust pipes in profile view as need it.

I can get the dynamo script to do steps 2-5 if I have only one polyline in the drawing. The question is, is it is possible to select multiple polylines? can dynamo do multiple objects in one run? Or may there is a different approach?

---

<div class="post-metadata">

**Author:** ![jMrkz5280](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jMrkz5280](https://forum.dynamobim.com/u/jMrkz5280)\
**Post date:** [November 16, 2021, 11:48pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/2 "2021-11-16T23:48:31Z")

</div>

![Create Alignmen-Profile-Profile views_2021-11-16_04-34-24](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/6/e6c66a609e3e436298a7be8f4f6cd096f1d4f0ec.png)

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [November 17, 2021, 3:53pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/3 "2021-11-17T15:53:01Z")

</div>

Hi @jMrkz5280 ,

There sure is a way in Dynamo to do multiple lines/ stuff in general at once. Could you maybe share a Sample file and your Dynamo-file?

---

<div class="post-metadata">

**Author:** ![jMrkz5280](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jMrkz5280](https://forum.dynamobim.com/u/jMrkz5280)\
**Post date:** [November 17, 2021, 4:21pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/4 "2021-11-17T16:21:20Z")

</div>

[Create Alignmen-Profile-Profile views.dyn](https://forum.dynamobim.com/uploads/short-url/9AtK1LPUvyPe2zGE5A0uuiyeKOl.dyn) (75.0 KB)

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [November 17, 2021, 4:27pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/5 "2021-11-17T16:27:18Z")

</div>

Hi @jMrkz5280,

A couple thoughts.

> [@jMrkz5280](#):
>
> Copy polylines from the existing utility file

Another idea here is to skip the process of copying the Polylines in from the other file and just get the geometry directly from an XREF. You can do that using the _Block.Objects_ node because an XREF is a Block Reference. Here’s an example to get all the Polylines from an XREF and then group them by layer.

 ![GetXREFData](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/7/e7c816e1638bf5b2a70aae5b6d9118ef44d04e76.png)

> [@jMrkz5280](#):
>
> - Create alignments
> - Create existing ground profiles
> - Generate profile views
> - Generate pipe networks from polylines
> - Project pipe networks to profile views
> - Adjust pipes in profile view as need it.

Unless there is an explicit need to have the Alignments, Profiles, and Profile Views, I think these steps could be simplified. Here’s an example of sampling a Surface along the Polylines and then dropping the geometry down. From there you can create Pipes or Solids depending on what you need.

![DropElevation](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/e/0e48a231e17f0cfd395f1d4c27d3d17db1c2bc10.gif)

[UtilityProfileExample.dyn](https://forum.dynamobim.com/uploads/short-url/heRJH0LipqX5nPH3kxroNksXZ9e.dyn) (33.5 KB)

---

<div class="post-metadata">

**Author:** ![jMrkz5280](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jMrkz5280](https://forum.dynamobim.com/u/jMrkz5280)\
**Post date:** [November 17, 2021, 4:29pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/6 "2021-11-17T16:29:28Z")

</div>

[Dynamo-Pipe Network Test.dwg](https://forum.dynamobim.com/uploads/short-url/fYgYktmpg6QrfMUaAHcpMtzitt5.dwg) (803.8 KB)

---

<div class="post-metadata">

**Author:** ![jMrkz5280](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jMrkz5280](https://forum.dynamobim.com/u/jMrkz5280)\
**Post date:** [November 17, 2021, 4:31pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/7 "2021-11-17T16:31:05Z")

</div>

Hi, @Daan I uploaded the dynamo script and the CAD test file. thanks for reaching out.

---

<div class="post-metadata">

**Author:** ![jMrkz5280](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jMrkz5280](https://forum.dynamobim.com/u/jMrkz5280)\
**Post date:** [November 17, 2021, 4:37pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/8 "2021-11-17T16:37:41Z")

</div>

Hi @zachri.jensen, I believe in the near future we no longer be needing plans and only models; in the meantime, we typically project the existing utility crossings into the design profiles. I use alignments and profiles so later, when we get depth information, we can adjust the pipe networks.

What you are showing is excellent! Thanks.

---

<div class="post-metadata">

**Author:** ![jMrkz5280](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jMrkz5280](https://forum.dynamobim.com/u/jMrkz5280)\
**Post date:** [December 13, 2021, 5:47pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/9 "2021-12-13T17:47:07Z")

</div>

Hi Zachri,

I tried your script. I added the PipeNetwork node to create the pipes and it worked, however, it only created one pipe regardless of the vertices in the polyline. This is what I noticed about the pipe creation.

- It creates one pipe ignoring the vertices on the polyline, however, the pipes are at elevation.
- If I used Geometry.Explode node, explodes the vertical component not the horizontal component of the polyline and it adds lots of pipes, little segments and it drops the elevations to zero.

I have another script to create the pipes. The script works, it creates multiple pipes from multiple polylines. It adds all the pipes to one network. However, I get an error message in CAD “unable to run macro C:////… ApplyRule" therefore the all the pipes are at zero elevations.

Attached are the cad file and the two dynamo scripts. Is there a way you can look at them and see is what I am doing wrong. The goal is to create multiple pipes from multiple polylines and apply the ruleset so the pipes are at elevation.

Thank you so much for your help.

[UtilityProfileExample-modified.dyn](https://forum.dynamobim.com/uploads/short-url/2Ef5BWsmx1o2k5DRhS8mPhg7uB4.dyn) (54.9 KB)  
[02\_Create Pipe Networks.dyn](https://forum.dynamobim.com/uploads/short-url/uT1WlQbFZa0QFdlxB2AC2WpHyma.dyn) (33.4 KB)  
[Dynamo-PipeNetwork Test.dwg](https://forum.dynamobim.com/uploads/short-url/qQ7Z3kH4kcM3nq7X50uVCvnBRg9.dwg) (869.0 KB)

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [March 29, 2022, 4:03pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/10 "2022-03-29T16:03:42Z")

</div>

Hi @jMrkz5280,

Did you get this figured out?

---

<div class="post-metadata">

**Author:** ![jMrkz5280](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jMrkz5280](https://forum.dynamobim.com/u/jMrkz5280)\
**Post date:** [March 29, 2022, 4:59pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/11 "2022-03-29T16:59:26Z")

</div>

Unfortunately I could not get it to work. I got to the point where the script creates multiple networks but the pipes are at zero elevation.

---

<div class="post-metadata">

**Author:** ![mkamel4P3D4](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@mkamel4P3D4](https://forum.dynamobim.com/u/mkamel4P3D4)\
**Post date:** [August 12, 2022, 2:22am UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/12 "2022-08-12T02:22:59Z")

</div>

first i want to thank you for your script and let me give you a hint for the cause of the problem you face,  
this is because the pipes have not a reference surface consequently the program will not be able to apply rules.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/2/622055d034240ce12b761c0a8c5e39a4bb5afdbc.png)

---

<div class="post-metadata">

**Author:** ![kidznok](https://avatars.discourse-cdn.com/v4/letter/k/db5fbb/32.png) [@kidznok](https://forum.dynamobim.com/u/kidznok)\
**Post date:** [November 18, 2022, 5:34pm UTC](https://forum.dynamobim.com/t/multiple-pipe-networks-from-multiple-polylines/70455/13 "2022-11-18T17:34:35Z")

</div>

Hi,  
I used this one and tried to create mapper (set corridor’s targets from xref) but it’s not work.  
I just start with Dynamo so sorry for mistakes.  
I would like upload but… “Sorry, new users can not upload attachments”
