Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Pressure Pipes API

5 REPLIES 5
Reply
Message 1 of 6
redtransitconsultants
1289 Views, 5 Replies

Pressure Pipes API

When will the Pressure Pipes API be fixed and work as expected? Unfortunately the API seems to have been rolled out and left in the weeds like the Pressure Pipes have been in the software. So much needs to be completed on this.

 

 

 

I've created 3 test commands to test pressure pipes.

 

The first one, collects the pressure networks and returns a count. That is working - 

 

<CommandMethod("TestPressurePipes")> Public Sub TestPressurePipes()
        Dim civDoc As CivilDocument = CivilApplication.ActiveDocument
        MsgBox(CivilDocumentPressurePipesExtension.GetPressurePipeNetworkIds(civDoc).Count)
    End Sub

The second one, prompts to select a pressure pipe and attempts to retrieve the 2D and 3D length. Both return an error and do not return the length.

 

 <CommandMethod("TestSelectPressurePipe")> Public Sub TestSelectPressurePipe()
        Dim civDoc As CivilDocument = CivilApplication.ActiveDocument
        Dim currEd As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor()
        Dim currDb As Database = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database

        Using tr As Transaction = currDb.TransactionManager.StartTransaction
            Dim srcprmpt1 = New PromptEntityOptions("Select Pressure Pipe: ")
            srcprmpt1.SetRejectMessage(vbLf & "Selected object is not a pressure pipe... ")
            srcprmpt1.AddAllowedClass(GetType(ACD.PressurePipe), False)
            srcprmpt1.AllowNone = True

            Dim srcres1 As PromptEntityResult = currEd.GetEntity(srcprmpt1)

            If srcres1.Status = PromptStatus.OK Then
                Dim pp As ACD.PressurePipe = TryCast(srcres1.ObjectId.GetObject(OpenMode.ForRead), ACD.PressurePipe)

                MsgBox(pp.Length2DCenterToCenter & vbCrLf & pp.Length3DCenterToCenter)
            End If
        End Using
    End Sub

The last command shows how a pressure network can retrun PipeIds and FittingIds, but it can't return AppurtenanceIds?

 

<CommandMethod("TestGetPressureNetorkObjects")> Public Sub TestGetPressureNetorkObjects()
        Dim civDoc As CivilDocument = CivilApplication.ActiveDocument
        Dim currEd As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor()
        Dim currDb As Database = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database

        Using tr As Transaction = currDb.TransactionManager.StartTransaction
            Dim srcprmpt1 = New PromptEntityOptions("Select Pressure Pipe: ")
            srcprmpt1.SetRejectMessage(vbLf & "Selected object is not a pressure pipe... ")
            srcprmpt1.AddAllowedClass(GetType(ACD.PressurePipe), False)
            srcprmpt1.AllowNone = True

            Dim srcres1 As PromptEntityResult = currEd.GetEntity(srcprmpt1)

            If srcres1.Status = PromptStatus.OK Then
                Dim pp As ACD.PressurePipe = TryCast(srcres1.ObjectId.GetObject(OpenMode.ForRead), ACD.PressurePipe)
                Dim net As ACD.PressurePipeNetwork = TryCast(pp.NetworkId.GetObject(OpenMode.ForRead), ACD.PressurePipeNetwork)

                MsgBox(net.GetFittingIds.Count)
                MsgBox(net.GetPipeIds.Count)
                MsgBox("How do we get appurtenances???? - there's not GetAppurtenanceIds method")
            End If
        End Using
    End Sub

 

See the video here of these commands in action - http://autode.sk/1TYRJF5

 

 

 

Steve

Steve Hill,Civil Designer / .NET Developer / AutoCAD and AutoCAD Civil 3D Certified Professional
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

http://redtransitconsultants.com/
Autodesk Exchange Store
Twitter | LinkedIn | YouTube

5 REPLIES 5
Message 2 of 6

I'd like to say that the problem stems from using VB.NET Smiley Very Happy That, however, is not the issue. I recall seeing a post a while back that said the PP API is "in flux". It would be nice to get this API, and even the in-C3d tools, up to snuff.

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 6

Ha! I know @Jeff_M, I really need to push myself to move to C#. I can read it, just can't write as fluently in it. Thankfully, they are interchangeable for the most part. Smiley Tongue

Spoiler
 

 

Steve Hill,Civil Designer / .NET Developer / AutoCAD and AutoCAD Civil 3D Certified Professional
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

http://redtransitconsultants.com/
Autodesk Exchange Store
Twitter | LinkedIn | YouTube

Message 4 of 6

Should just skip to c++ and confuse us 😉


"Very funny, Scotty. Now beam down my clothes.
Message 5 of 6

Indeed the pressure pipe API is on our list for future improvements.

I would suggest to include it on https://forums.autodesk.com/t5/autocad-civil-3d-ideas/idb-p/31/tab/most-recent so dev team is aware of developer needs.

Thanks for your feedback!
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 6 of 6

@redtransitconsultants , @brianchapmandesign ,

 

I've filed a case for pressure pipe support at ideas forum, please consider to go there and give it a vote if you want it to be done quickly

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report