Is there any node available to break a civil 3d pipe

is there any node available to break a civil 3d pipe

Hi
I am Think nothing For this in civil api

Thought 1: You could try using a number of nodes to get the pipe coordinates, part, size, etc…delete the original pipe, then create two identical pipes in its place. A bit involved, but seems possible.

Thought 2: You could try inserting a null structure at the break-point to split the pipe into two, then immediatly delete the null…not sure if a node exists to insert a structure midway on a pipe in the same way you can when editing a pipe network manually in Civil 3D…so not sure how viable this is…maybe a python thing??

Broadly speaking, I don’t think you can simply break a pipe manually in Civil 3D like you can a polyline. So, you would need to think through how you would do it in the program, then try and duplicate that workflow in Dynamo. Most things in Dynamo for Civil 3D access the API and execute existing operations…breaking a pipe would be an enteirly new operation and not found in the API…I beleive, but I could be wrong.

I’d go with a modification of this, similar to how Revit implementations are done.

  1. Get the existing pipe’s start, mid, end, end connected structure.
  2. Set the current pipe’s location to the start end mid point.
  3. Draw a new pipe from the midpoint to the previous end.
  4. Connect the new pipe to the midpoint and the structure.

By keeping the original pipe you maintain more of the original properties in the current design, which may also be helpful for associating data to the new pipe.

I thought there was a node in the Civil 3D Toolkit for this, but I could be wrong. Either way, there’s a dedicated API method for this, so it’s probably a bit overkill to reinvent the wheel.

1 Like

Good to know it’s there. In my quick review I couldn’t find anything though. Perhaps buried somewhere?

https://help.autodesk.com/view/CIV3D/2023/ENU/?guid=4587d91f-61a0-c49e-6fe0-1e6551ae2b4b

Ah! In the network class. Why didn’t I think to look there for ran element level modification?

Seriously though, that one is almost as unintuitive as the Revit API… Sadly I don’t see one in the Civil 3D toolkit. I’ll look at some Python for it tomorrow as it’ll help a current project along.

1 Like

Do we have this as python for civil3d to break pipe at specific point ?

It probably would look something like this:

import traceback
err = []

dynpt = IN[0]
pipetobreak = IN[1]
structure_at_break = IN[2]
point3d = Point3d(dynpt.X,dynpt.Y,dynpt.Z)


with adoc.LockDocument():
    with adoc.Database as db:
        with db.TransactionManager.StartTransaction() as t:
            try:
                pipe = t.GetObject(pipetobreak.InternalObjectId,OpenMode.ForWrite)
                networkid = pipe.NetworkId
                network = t.GetObject(networkid, OpenMode.ForWrite)
                newid = ObjectId()
                network.BreakPipe(pipetobreak.InternalObjectId, point3d, structure_at_break.InternalObjectId, newid)
            except:
                err.append(traceback.format_exc())
            t.Commit()

# Assign your output to the OUT variable.
if len(err) > 0:
    OUT = err
else:
    OUT = None

However: If the structure and/or breakpoint is not on the pipe, the nearest point on the pipe will be used and the stucture is moved to this break point. I’m not sure whether you want this to happen.

1 Like