Author Topic: Cardinal Direction for Connected Pipes and Sorting by Invert Elevation  (Read 4333 times)

0 Members and 1 Guest are viewing this topic.


  • Guest
I am working in VBA to automate the creation of Cogo Points for Pipe Network Structures in Civil 3D 2015, where the user selects the structures on screen, then the points are created, and a cut sheet is generated in Excel that has the RIM elevation, and cycles through the connected pipes to provide the invert elevations. In Civil 3D the Cardinal Direction can be added to a structure label style using "<[Connected Pipe Direction(CP)]>". Can I obtain this information in VBA/VB.NET code? I have a reference to the Structure itself, as well as each of the connected pipes, I just can't seem to determine how to access this property (if it exists).

Also, right now I output the pipe invert elevations to excel in the order of their index:

For k = 0 To oStructure.Connectors.Count - 1
                    If (TypeOf oStructure.Connectors.Item(k).NetworkPart Is IAeccPipe) Then
                        Set oPipe = oStructure.Connectors.Item(k).NetworkPart
                        Call EnterPipeInverts(sheetStructures, oStructure.IsConnectedPipeFlowingIn(k), oPipe, iRowStructures)
                    End If
Next k

but I would prefer to sort the connected pipe inverts from highest to lowest, so the IE Out is the last output. Is there a strait forward means to achieve this?

Thank you,

Mike Killion


  • King Gator
  • Posts: 4100
  • C3D user & customizer
For the inverts, they get returned in the order they were created. So just place them all in a list and sort it. For the direction, you have to calculate that from the Pipe object's start/end points.


  • Guest
Thanks for the response Jeff. I was hoping there was a property or method for this, but will proceed as you described.