Identifying Pipe/Structure Labels in Profile/Section View

Identifying Pipe/Structure Labels in Profile/Section View

HEBC3D
Enthusiast Enthusiast
216 Views
1 Reply
Message 1 of 2

Identifying Pipe/Structure Labels in Profile/Section View

HEBC3D
Enthusiast
Enthusiast

I've been in the process of making a small plugin that labels pipe/pressure networks in section/profile/plan views with their choice of label per network. I was able to get a pretty well functioning program running for pressure networks and avoiding duplicate labels for multiple parts in section views due to the PressurePipeSectionLabel.GetAvailableLabelIds method turning the pipe/fitting/appurtenance IDs to associate the label with a part and view to avoid duplication.

 

Unfortunately, when we look at the PipeSectionLabel.GetAvailableLabelIds method, it only will only return the SectionViewID for the pipe/structure labels. Seems like they just improved the newer API and didn't really backtrack to pipe networks for something like this. Looks like all of the label methods/properties for pipes and structures are missing this in general. I know it's a weird mix of them being pipes/structures and 'parts' so I've been looking through all of those as well but nothing to really get the pipe or structure ID for them.

 

Is there any way that the pipe or structure section label can be linked to a part that I'm missing here? I see in the label creation method there's a section for the partIndex of the SectionPipeNetwork which is how I assume it associates the label to the sections pipe network part but I can't find any way to access it outside of the label creation method? I know there's also Part.SectionViewPartId but I'm gonna go ahead and guess that returns the ObjectID of the SectionPipeNetwork.

 

Any insight would be great! If anything, it'll just be a warning that the labeler should only be run when there are no labels for the pipes and structures to avoid duplicates.

217 Views
1 Reply
Reply (1)
Message 2 of 2

SoaresASBCAD
Collaborator
Collaborator

Unfortunately, that limitation is pretty much how the older Pipe Network API behaves in Autodesk Civil 3D.

PressurePipeSectionLabel.GetAvailableLabelIds() was improved and exposes the associated part information, but the legacy PipeSectionLabel API never received the same treatment. For gravity Pipe Networks, the section label objects are still fairly limited and mostly tied to the SectionViewId.

You’re correct that:

  • partIndex is used internally during label creation
  • but Autodesk never exposed a clean public getter for retrieving the associated pipe/structure afterward

And yes, Part.SectionViewPartId points to the SectionPipeNetwork representation rather than directly back to the original pipe/structure label association.

From what I’ve seen, most developers handle this one of three ways:

  • Track created labels manually in your own dictionary/cache during creation
  • Compare geometry/section positions to infer association
  • Or simply prevent rerunning the labeling routine if labels already exist

So your fallback approach (“only run when no labels exist”) is honestly pretty reasonable given the API gap.

It definitely feels like the Pressure Network API got modernized while the legacy Pipe Network API was left behind.

ASoares
0 Likes