Pipe Network Structures Labels

Pipe Network Structures Labels

lkrznaricX6MEV
Participant Participant
401 Views
3 Replies
Message 1 of 4

Pipe Network Structures Labels

lkrznaricX6MEV
Participant
Participant

complicated problem, hopefully I can explain it well enough.

 

I would like my pipe networks to automatically label my pipe structures with very simple description. is there a way to change the structure description in the parts list for each individual part so that i can modify my label style to take that description and use it as a label?  

 

lkrznaricX6MEV_0-1662143845367.png

 

lkrznaricX6MEV_1-1662143959955.pnglkrznaricX6MEV_2-1662143998470.png

 

 

i would like my water valves to say "WV" and my tee's to say "TEE" with out needing to manually change the label style every time i place a new part.

 

Thanks

0 Likes
Accepted solutions (1)
402 Views
3 Replies
Replies (3)
Message 2 of 4

hosneyalaa
Advisor
Advisor

my language is not good
I understand a bit about you
But I did not understand what the problem is

Its name can be changed through the code with some changes

 

 
https://help.autodesk.com/view/CIV3D/2022/ENU/?guid=8bac057e-1d39-b8df-ca9a-11f82cf12e7e


1[CommandMethod("testSizeDataRecord")]
 2public void testSizeDataRecord () {
 3    Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction();
 4
 5    PartsListCollection col = CivilApplication.ActiveDocument.Styles.PartsListSet;
 6    PartsList partList1 = ts.GetObject(col["Standard"], OpenMode.ForWrite) as PartsList;
 7    PartFamily partFamily = ts.GetObject(partList1["Concrete Pipe"], OpenMode.ForWrite) as PartFamily;
 8    PartSize partSize = ts.GetObject(partFamily["12 inch Concrete Pipe"], OpenMode.ForWrite) as PartSize;
 9
10    // Save a reference to the SizeDataRecord to restore later.
11    PartDataRecord record = partSize.SizeDataRecord;
12    PartDataField field = record.GetDataFieldBy(PartContextType.MinCurveRadius);
13    field.Value = 1.0;
14    double newVal = ( double )field.Value;
15
16    // Re-set the SizeDataRecord property.  The data will not be saved without this step.
17    partSize.SizeDataRecord = record;
18
19    ts.Commit();
20}

 

 

0 Likes
Message 3 of 4

tyronebk
Collaborator
Collaborator
Accepted solution

Would this workflow work for you?

 

Change this setting in Toolspace > Settings > <drawing> > Pipe Networks > Commands > Edit Feature Settings to Yes:

tyronebk_0-1662489388806.png

 

Now, when you add or swap a part the description is populated with the text specified in the parts list name column:

tyronebk_1-1662489512645.png

You can now create a very simple label style that only calls out the part description (along with anything else you need to include):

tyronebk_2-1662489605595.png

That single label style will now display this:

tyronebk_3-1662489704015.png

 

Message 4 of 4

lkrznaricX6MEV
Participant
Participant

exactly what I needed. Thanks!

0 Likes