Is it possible to convert a gravity network to a pressure network in Civil3D?

Hello there, I’m looking to convert a gravity pipe network to a pressure network using dynamo and python. Although the run time is very slow, I am able to get polylines from the gravity network using dynamo, but I am running into issues with using those polylines to create pressure pipes. It seems like I’m just looking to loop the ‘Create Pressure Network from Object’ with a list of polylines.

I’m very new to using the Civil3D API, but I noticed there isn’t a FilteredElementCollector class to get the polylines from an open project.

I’ve tried using the PressurePipeRun.ByObject node from the camber package, and I’m running into issues feeding a PressurePartSize into it. I’m not sure how to get the PressurePartSize info from the Civil file.

Any feedback or guidance would be greatly appreciated.

Thank you for your time,
Chris

Here is my attempt at collecting all the polylines in a project, there is no FilteredElementCollector like in the Revit API.

Load the Python Standard and DesignScript Libraries

import sys
import clr

Add Assemblies for AutoCAD and Civil3D

clr.AddReference(‘AcMgd’)
clr.AddReference(‘AcCoreMgd’)
clr.AddReference(‘AcDbMgd’)
clr.AddReference(‘AecBaseMgd’)
clr.AddReference(‘AecPropDataMgd’)
clr.AddReference(‘AeccDbMgd’)

Import references from AutoCAD

from Autodesk.AutoCAD.Runtime import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.EditorInput import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *

Import references from Civil3D

from Autodesk.Civil.ApplicationServices import *
from Autodesk.Civil.DatabaseServices import *

The inputs to this node will be stored as a list in the IN variables.

dataEnteringNode = IN

adoc = Application.DocumentManager.MdiActiveDocument
editor = adoc.Editor

#clr.AddReference(‘RevitServices’)
#from RevitServices.Persistence import DocumentManager

#clr.AddReference(‘RevitAPI’)
#import Autodesk
#from Autodesk.Revit.DB import *

Reference the active document

#doc = DocumentManager.Instance.CurrentDBDocument

Collect model lines

collector = FilteredElementCollector(adoc).OfCategory(BuiltInCategory.OST_Lines).WhereElementIsNotElementType().ToElements()

Create an empty list to store the model lines

model_lines =

Append each model line to the list

for line in collector:
model_lines.append(line)

Return the list of model lines

OUT = model_lines