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.
http://redtransitconsultants.com/
Autodesk Exchange Store
Twitter | LinkedIn | YouTube
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.
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.
http://redtransitconsultants.com/
Autodesk Exchange Store
Twitter | LinkedIn | YouTube
Should just skip to c++ and confuse us 😉
@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.