Create Pipes from polylines

Dears,
I’m simply trying to create pipes from polylines, but something is going wrong with the(PipeNetwork.AddPipeByCurve) node.
This error shows up"Warning: PipeNetwork.AddPipeByCurve operation failed.
Object reference not set to an instance of an object."

The model only contains some 2d polylines drawn by me, and pipe network named “test” for the sake of testing

CreatePipesFromPolylines.dyn (22.8 KB)

I managed to solve the issue by changing the object type from polyline to polyline. but another issue shows up that it just creates one pipe instead of multiple pipes. any clue ?

Check the levels, it might resolve the issue.

what levels exactly ?

Apologies, i am not at the desk. but check the levels in node. if you right click you will see it. change levels from 0 to 2 or so on. hope it will resolve the issue.

sorry I can’t get your point

@MohamedR.Nasreldeen - probably good to read about levels if you’re unfamiliar.

https://primer.dynamobim.org/06_Designing-with-Lists/6-3_lists-of-lists.html

4 Likes

@shahid.shaikh_C3D @zachri.jensen
That helped a lot… thanks a lot


For the Polycurves, my structures are happy doing multiple but my place pipes is not liking the curves, do I need another node in there? I appreciate it! I’m sure everyone is busy scoping out CAMBER, but maybe someone can help, its so close.

I think it has to be a Line or Arc, not a PolyCurve?

1 Like

@zachri.jensen funny thing is it works fine if I filter out just one of the polylines and run the same way. This works sort of, it does’nt draw all 11 segments but draws in one, it should follow the white polyline on the horizontal one, its missing all the in-between segments. Looked for a node to transform curves to lines, but can’t find one yet:

image

This actually got really close. Returned an error, but its drawing a bunch of them in. Full curves though, so good for pressure networks, not so much gravity:

Geometry.Explode

3 Likes

…and just like that my friday afternoon gets way better and I get to do the little Dynamo Fist Pump we all do when a script actually works for the first time. Thanks Zachri

3 Likes

Hi @nick.turner66KAP

Have some questions about the pipe network script.

  1. Are the Rule Set being applied to your pipes? I run the script, and in my case, is not apply the ruleset.
  2. The script won’t create the pipe network. The Pipe Network should exist in Civil 3D, and the script will add pipes to the pipe network. Is that right?
  3. Is it one pipe network per polyline in your drawing?

Thanks.