Thank you for sparing time to read this post.
I have been working through a few queries regarding labels and the data that our engineers want to have on the labels. To add a bit of context to the query, I have created and published pipes which have a custom parameter (Status). For pipe labels I can use this custom perimeter, which isn't needed as the pipe style line color refers the the status of the pipe. However, when labeling the structures with the connected pipes, or creating the manhole schedule, they want to see Pipe Name - IL In/Out (Status). Most of which is easy, however in the connected pipes properties does not show the custom property.
Is there a way of adding to the connected pipe properties to include the pipe status (i.e. Connected Pipe Status)?
Hi there are two ways of doing this,
Through property sets or through pipe contexts.
To add a pipe context you need to amend the C:\ProgramData\Autodesk\C3D 20XX\enu\Pipes Catalog\Aecc Shared Content\AeccPartParamCfg.xml file.
To add a new context, look for a similar context and copy it to the end of the <AeccParamDeclaration> section.
<AeccDfParameter name="Mat" desc="Material" context="Material_Type" index="0" datatype="String" usage="String_General" managelist="True" unit="" visible="True" internal="True"/> seems to be a match as its for strings. Managelist allows saving of the entries, change to false if not needed.
Paste at the end of the section and change the Name, Desc and Context accordingly to suit your needs ensuring no duplications.
Next you need to add this into the relevant section later in the document. For pipes see below.
</AeccParamDeclaration>
<AeccParamUsage>
<AeccPartDomainCfg domain="Pipe_Domain">
As this is an optional parameter we would add as;
<AeccOptParam context="RefContext"/>
To enable this you need to save the changes and restart Civil3d.
To edit the files I would use NotePad++ or similar as these show the formatting.
Mike
@MikeEvansUK thank you for the message, this has all been done. I can see the parameter in the Pipe Data Properties and when creating a Pipe Label I can choose the custom parameter.
The problem comes in the connected pipes, it shows virtually all the properties from the pipe data with the pre-fix Connected Pipe, however it doesn't show the custom parameter, for instance Connected Pipe Status.
This is possible with property sets but complicated.
First you need the handle of the structure then you need to cycle through the structures connected pipes and get the handle of the in or outflow pipe as the result.
this handle can then be used in another calc to find by context the item you’re after adding as a result.
the final result can be added to the label under the property data.
it’s a little trick but I’ll see if I can post something to help understand..
m
@MikeEvansUK Thank you for your response. If I read your message correctly this would need to be a property set for each structure, and each pipe that is connecting to it?
I'm not sure if this would be feasible as the team do not necessarily have that level of experience, I was hoping to create a label that could be added to the shared template. Its a shame that they have hard coded connected pipe parameters, would have been so easy if we could just create custom properties similar to creating an expression.
Sorry yes through property sets and not that simple but with some help..
Create a new Object: [OutFlowPipeObjectId]
Code,
RESULT="-"
On Error Resume Next
Set oApp=GetObject(, "AutoCAD.Application")
Set oCivilApp=oApp.GetInterfaceObject("[_XUILand]")
Set aec = oApp.GetInterfaceObject("[_AecVal]")
aec.Init oApp
Set obj=oCivilApp.ActiveDocument.ObjectIdToObject("[ObjectID]")
Brk=0
Pip
i=0
PipId
For i = 0 To obj.ConnectedPipesCount - 1
Set Pip=Obj.ConnectedPipe(i)
If obj.IsConnectedPipeFlowingOut(i) then 'This should work? not checked .com
PipId = i
end if
Next
Result = Obj.ConnectedPipe(PipId).Objectid
Using that object..
[UserVariable]
Code,
RESULT="-"
On Error Resume Next
Set oApp=GetObject(, "AutoCAD.Application")
Set oCivilApp=oApp.GetInterfaceObject("[_XUILand]")
Set aec = oApp.GetInterfaceObject("[[_AecVal]")
aec.Init oApp
Set obj=oCivilApp.ActiveDocument.ObjectIdToObject("[ObjectID]")
Set Pip = oCivilApp.ActiveDocument.ObjectIdToObject("[OutFlowPipeObjectId]")
RESULT=obj.PartDataRecord.FindByContext("Material_Type").Tag
Change Material_Type to the relevant Contect string you want..
Search for how to use Property sets, as I said it's simppler via pipes as this is directly open to the label.
Mike
Can't find what you're looking for? Ask the community or share your knowledge.