# How can I create a Pressure Network?

**URL:** <https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397>\
**Category:** Civil 3D\
**Tags:** python, dynamo\
**Created:** [September 20, 2021, 2:15pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397 "2021-09-20T14:15:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![andre.demski](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andre.demski/32/124887_2.png) [@andre.demski](https://forum.dynamobim.com/u/andre.demski)\
**Post date:** [September 20, 2021, 2:15pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/1 "2021-09-20T14:15:31Z")

</div>

Hello,

I’m trying to create a new Pressure network in my file. But when I do this in a python script, it creates a Pressure Network Id but it doesn’t appear in ToolSpace. In my code I checked the database of the file if there really was any network and the Id of the network I created appeared.

I tried to create a Pressure Pipe in this Network, but I have the same problem, it creates a Pressure Pipe Id, but my pipe doesn’t appear in the model.

Someone knows how can I correct this?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/9/99fb31670cb4bf4fe2bdce3daf0a6a5939e9d661.png)

```auto
# Load the Python Standard and DesignScript Libraries
import sys #sys is a fundamental Python library - here, we're using it to load in the standard IronPython libraries
import clr #This is .NET's Common Language Runtime. It's an execution environment that is able to execute code from several different languages.
import os
import math

# Add Assemblies for AutoCAD and Civil 3D APIs
clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AecBaseMgd')
clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')
clr.AddReference('ProtoGeometry') #A Dynamo library for its proxy geometry
#classes. You'll only need this if you're interacting with geometry
clr.AddReference('AeccPressurePipesMgd')
clr.AddReference('System.Windows.Forms')
clr.AddReference('acdbmgdbrep')
clr.AddReference('Civil3DNodes')
clr.AddReference('AutoCADNodes')

# Add references to manage arrays, collections and interact with the user
from System import *
from System.IO import *
from System.Collections.Specialized import *
from System.Windows.Forms import MessageBox

import Autodesk #Loads the Autodesk namespace
# Import references from AutoCAD
AAR = Autodesk.AutoCAD.Runtime
AAA = Autodesk.AutoCAD.ApplicationServices #Setting a handle to the currently-open instance of the AutoCAD application
AAD = Autodesk.AutoCAD.DatabaseServices
AAE = Autodesk.AutoCAD.EditorInput
AAG = Autodesk.AutoCAD.Geometry
AADy = Autodesk.AutoCAD.DynamoNodes

AUX = Autodesk.Aec.DatabaseServices

OP = AAD.OpenMode
TS = AAD.Transaction

# Import references from Civil3D
ACA = Autodesk.Civil.ApplicationServices #Setting a handle to the currently-open instance of the Civil3D application
ACD = Autodesk.Civil.DatabaseServices
ACDy = Autodesk.Civil.DynamoNodes

AD = ACA.CivilApplication.ActiveDocument #Finally, setting up handles to the active Civil3D document
ACAC = Autodesk.Civil.ApplicationServices.CivilDocumentPressurePipesExtension
adoc = AAA.Application.DocumentManager.MdiActiveDocument
editor = adoc.Editor

with adoc.LockDocument():
    with adoc.Database as db:

        with db.TransactionManager.StartTransaction() as t:
            # E vem ai

            #1 - Create a new Pressure Pipe Network:
            NewNet = ACD.PressurePipeNetwork.Create(db,IN[0])

            #2 - Read from database all Pressure Networks ids:
            PressureNetwork_Ids = ACAC.GetPressurePipeNetworkIds(AD)            

# Assign your output to the OUT variable.
OUT = NewNet,PressureNetwork_Ids

```

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [September 20, 2021, 7:10pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/2 "2021-09-20T19:10:57Z")

</div>

hi  
I think first you should get this PressurePartListCollection Members  
[PressurePartListCollection Members](https://help.autodesk.com/view/CIV3D/2022/ENU/?guid=61624264-d148-e0e7-832c-5b363d34564d)  
and  
[PressurePartList Members](https://help.autodesk.com/view/CIV3D/2021/ENU/?guid=843fb32a-a6d1-a390-e6ae-fe0453ca5f4a)

I was trying it and couldn’t get a result

Have you tried to get it

 ![qw](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/c/1c85bd1ab0c60ceee72e7d07717525c5028c8f19.png)

---

<div class="post-metadata">

**Author:** ![andre.demski](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andre.demski/32/124887_2.png) [@andre.demski](https://forum.dynamobim.com/u/andre.demski)\
**Post date:** [September 20, 2021, 7:36pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/3 "2021-09-20T19:36:11Z")

</div>

I’ve already managed to create a pressure pipe, I already know how to read and see the part lists. But even creating, it doesn’t appear in my file.

```auto
# Load the Python Standard and DesignScript Libraries
import sys #sys is a fundamental Python library - here, we're using it to load in the standard IronPython libraries
import clr #This is .NET's Common Language Runtime. It's an execution environment that is able to execute code from several different languages.
import os
import math

# Add Assemblies for AutoCAD and Civil 3D APIs
clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')
clr.AddReference('AecBaseMgd')
clr.AddReference('AecPropDataMgd')
clr.AddReference('AeccDbMgd')
clr.AddReference('ProtoGeometry') #A Dynamo library for its proxy geometry
#classes. You'll only need this if you're interacting with geometry
clr.AddReference('AeccPressurePipesMgd')
clr.AddReference('System.Windows.Forms')
clr.AddReference('acdbmgdbrep')
clr.AddReference('Civil3DNodes')
clr.AddReference('AutoCADNodes')

# Add references to manage arrays, collections and interact with the user
from System import *
from System.IO import *
from System.Collections.Specialized import *
from System.Windows.Forms import MessageBox

import Autodesk #Loads the Autodesk namespace
# Import references from AutoCAD
AAR = Autodesk.AutoCAD.Runtime
AAA = Autodesk.AutoCAD.ApplicationServices #Setting a handle to the currently-open instance of the AutoCAD application
AAD = Autodesk.AutoCAD.DatabaseServices
AAE = Autodesk.AutoCAD.EditorInput
AAG = Autodesk.AutoCAD.Geometry
AADy = Autodesk.AutoCAD.DynamoNodes

AUX = Autodesk.Aec.DatabaseServices

OP = AAD.OpenMode
TS = AAD.Transaction

# Import references from Civil3D
ACA = Autodesk.Civil.ApplicationServices #Setting a handle to the currently-open instance of the Civil3D application
ACD = Autodesk.Civil.DatabaseServices
ACDy = Autodesk.Civil.DynamoNodes

AD = ACA.CivilApplication.ActiveDocument #Finally, setting up handles to the active Civil3D document
ACAC = Autodesk.Civil.ApplicationServices.CivilDocumentPressurePipesExtension
adoc = AAA.Application.DocumentManager.MdiActiveDocument
editor = adoc.Editor

with adoc.LockDocument():
    with adoc.Database as db:

        with db.TransactionManager.StartTransaction() as t:
            # E vem ai
            
            #1 - Coletar e pega a PartList escolhida para a pressure pipes (Collect and get the partlist choose to pressure pipe):
                        
            PartList_Collection = ACD.Styles.PressurePartList.GetAvailablePartLists(db) 
            PartList_Selected = []
            for id in PartList_Collection:
                PartList = TS.GetObject(t,id,OP.ForRead)
                PartList_Description = PartList.Description
                if PartList_Description.Contains(IN[0]) is True:
                    PartList_Selected = PartList
            
            #2 - Ler o catálogo (Read the catalog):
            
            PipeType = ACD.PressurePartDomainType.Pipe
            FittingsType = ACD.PressurePartDomainType.Fitting
            PipeSize = PartList_Selected.GetParts(PipeType) 
            PipeSize_Name = []
            FittingsSize = PartList_Selected.GetParts(FittingsType)
            FittingsSize_Name = []
            for i in PipeSize:
                PipeSize_Name.append(i.Description)
                
            for i in FittingsSize: 
                FittingsSize_Name.append(i.Description)
                
            #3 - Criar Pressure Network pelo nome (Create Pressure Network by name):
            NewNet = ACD.PressurePipeNetwork.Create(db,IN[1])
            Net = TS.GetObject(t,NewNet,OP.ForWrite)
            Net.UpgradeOpen()
            
            Ponto1 = AAG.Point3d(279867.7154,9114672.9238,0)
            Ponto2 = AAG.Point3d(279785.0385,9114495.0680,0)
            Linha = AAG.LineSegment3d(Ponto1,Ponto2)
            
            #Create Pressure Pipe by Line and PipePartSize
            TuboTeste = Net.AddLinePipe(Linha,PipeSize[0])
            Pipe = TS.GetObject(t,TuboTeste,OP.ForWrite)
            
# Assign your output to the OUT variable.
OUT = dir(Net)

```

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [September 20, 2021, 7:41pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/4 "2021-09-20T19:41:11Z")

</div>

good job  
Thanks for sharing the code Tomorrow

I will try it can i get a result?

---

<div class="post-metadata">

**Author:** ![andre.demski](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andre.demski/32/124887_2.png) [@andre.demski](https://forum.dynamobim.com/u/andre.demski)\
**Post date:** [September 20, 2021, 7:46pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/5 "2021-09-20T19:46:01Z")

</div>

You must already have a catalog and partlist on file. I filtered by name (ex. “R22”) and was able to access the tubes and fittings.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/9/790db7aa3002b078f608820fcfb288835f1a8e22.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/0/10cf51d1d9f26b77bec6155e1e80d47c0f18c1d1.png)

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [September 20, 2021, 7:56pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/6 "2021-09-20T19:56:29Z")

</div>

Did you try to add another line?  
Code  
t.Commit()

---

<div class="post-metadata">

**Author:** ![andre.demski](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andre.demski/32/124887_2.png) [@andre.demski](https://forum.dynamobim.com/u/andre.demski)\
**Post date:** [September 20, 2021, 7:59pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/7 "2021-09-20T19:59:40Z")

</div>

OMG! Worked!!! Thanks!!

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/1/e1766d73e1634dcfef1bd3a383af85de672569f9.jpeg)

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [September 20, 2021, 8:01pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/8 "2021-09-20T20:01:42Z")

</div>

good job

We wish you good luck  
Thanks

---

<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:** [October 13, 2021, 12:22am UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/9 "2021-10-13T00:22:46Z")

</div>

@hosneyalaa @andre.demski FYI there are some nodes in Camber to create and work with Pressure Networks.

 ![CreatePressureNetwork](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/1/31e144e3a5cdb7d2cb711d3a7b3d55472de7d141.jpeg)

---

<div class="post-metadata">

**Author:** ![Ahassona](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Ahassona](https://forum.dynamobim.com/u/Ahassona)\
**Post date:** [October 16, 2021, 7:25am UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/10 "2021-10-16T07:25:32Z")

</div>

Dear demski,

it is a great example for create the pressure network, but the problem is how we can add the pressure fitting to the network, do you have any example for that and i will be gratefully.

---

<div class="post-metadata">

**Author:** ![nick.turner66KAP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick.turner66kap/32/104191_2.png) [@nick.turner66KAP](https://forum.dynamobim.com/u/nick.turner66KAP)\
**Post date:** [November 8, 2021, 10:45pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/11 "2021-11-08T22:45:08Z")

</div>

@zachri.jensen I have been tinkering with the Pressure nodes in Camber, really good stuff. I hav’nt figured out how to tie them all together in a workflow yet. Do you have any images of eamples? Thanks!

---

<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 9, 2021, 12:01am UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/12 "2021-11-09T00:01:24Z")

</div>

> [@nick.turner66KAP](#):
>
> I hav’nt figured out how to tie them all together in a workflow yet.

Haha I haven’t either! 🤣

I did enough testing to know that they work, but didn’t have time for much more than that. I was hoping someone would play around with it and then share their experience. There’s more functionality that exists in the API that I haven’t had time to implement yet, so I’d love to know if you think of some nodes that would be important for various workflows.

As a side note, I’ve learned that developing stuff like this (and probably any software for that matter) is a delicate balance between identifying the key features that are actually useful versus just making a tool that has every available option under the sun. The API is quite extensive, so if there was a Dynamo node for everything it would be a monster. So in summary, I’m keen to hear what is useful and what isn’t, or what you think is missing. I usually come up with ideas for new nodes as I’m working on my day-to-day projects, but I haven’t done one lately that needed Pressure Networks.

---

<div class="post-metadata">

**Author:** ![nick.turner66KAP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick.turner66kap/32/104191_2.png) [@nick.turner66KAP](https://forum.dynamobim.com/u/nick.turner66KAP)\
**Post date:** [November 9, 2021, 12:34am UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/13 "2021-11-09T00:34:47Z")

</div>

Really it’s just these 2 nodes from Gravity Pipes that are needed, ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/0/30a59e498ffb0095c4abc333fa5c3d704f472b7b.png)

---

<div class="post-metadata">

**Author:** ![nick.turner66KAP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick.turner66kap/32/104191_2.png) [@nick.turner66KAP](https://forum.dynamobim.com/u/nick.turner66KAP)\
**Post date:** [November 9, 2021, 3:07pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/14 "2021-11-09T15:07:21Z")

</div>

Anybody want to team up and try to get the Pressure Network Nodes into something cool for the community? May require some Python for the 2 nodes above? @KirkWM

---

<div class="post-metadata">

**Author:** ![alexisgacia](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@alexisgacia](https://forum.dynamobim.com/u/alexisgacia)\
**Post date:** [November 18, 2021, 1:28pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/15 "2021-11-18T13:28:11Z")

</div>

> [@zachri.jensen](#):
>
> st making a tool that has every available option under the sun. The API is quite extensive, so if there was a Dynamo node for everything it would be a monster. So in summary, I’m keen to hear what is useful and what isn’t, or what you think is missing. I usually come up with ideas for new nodes as I’m working on my day-to-day projects, but I haven’t done one lately that needed Pressure Networks.

Great stuff out there. I think, its useful too that you add the following:

- AddPressurePipe from Object or Curve
- AddPipeRunFromObject from Object or Curve

---

<div class="post-metadata">

**Author:** ![Ahmed\_Ramy](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@Ahmed\_Ramy](https://forum.dynamobim.com/u/Ahmed_Ramy)\
**Post date:** [July 20, 2022, 12:15pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/16 "2022-07-20T12:15:02Z")

</div>

> [@andre.demski](#):
>
> `AeccDbMgd`

Hi Andre ! I really appreciate your efforts and sharing them with us ! May you tell me what learning materials or steps I have to go through in order to understand C3D native runtime language??

Thanks !!!

---

<div class="post-metadata">

**Author:** ![ddrennen2QDK2](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@ddrennen2QDK2](https://forum.dynamobim.com/u/ddrennen2QDK2)\
**Post date:** [February 22, 2023, 3:14pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/17 "2023-02-22T15:14:04Z")

</div>

I would like to vote for these two nodes to be added to the pressure network Camber Catalog. Any updates would be much appreciated. I looked moments ago and didn’t see anything that creates pipes, fittings, or appurtenances. (may have missed them though)

---

<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:** [February 22, 2023, 4:24pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/18 "2023-02-22T16:24:44Z")

</div>

I’ll add them to the list 👍

---

<div class="post-metadata">

**Author:** ![Manrajan.Kalimuthu1](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Manrajan.Kalimuthu1](https://forum.dynamobim.com/u/Manrajan.Kalimuthu1)\
**Post date:** [April 9, 2023, 4:21pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/19 "2023-04-09T16:21:21Z")

</div>

Hi @mzjensen,

I used Pressurepiperun.ByObject node. In this node surfaceOffset not working I think surface reference option should be there in this node

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/2/e24358c98585ea201095d325204cff1008ca0eb5.png)

I was tried to use pipe run profile option in dynamo. I have end up with error. Could you please assist me

 ![MicrosoftTeams-image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/0/8006266d8752c6fd4c9330cc7d75a565c04c9839.png)

---

<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:** [April 9, 2023, 8:27pm UTC](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397/20 "2023-04-09T20:27:55Z")

</div>

Hi @Manrajan.Kalimuthu1,

The reference surface is set for the entire pressure network, not for individual pipe runs.

[Next page](https://forum.dynamobim.com/t/how-can-i-create-a-pressure-network/68397.md?page=2)
