TheSwamp

Code Red => VB(A) => Topic started by: mikekillion on June 24, 2016, 04:20:24 PM

Title: Cardinal Direction for Connected Pipes and Sorting by Invert Elevation
Post by: mikekillion on June 24, 2016, 04:20:24 PM
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
Title: Re: Cardinal Direction for Connected Pipes and Sorting by Invert Elevation
Post by: Jeff_M on June 24, 2016, 05:51:53 PM
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.
Title: Re: Cardinal Direction for Connected Pipes and Sorting by Invert Elevation
Post by: mikekillion on June 24, 2016, 06:06:23 PM
Thanks for the response Jeff. I was hoping there was a property or method for this, but will proceed as you described.

Mike