Set name for civil 3d pipes

I’m trying to rename pipes as shown below, I don’t know whats wrong here

What is the warning on CivilObject.SetName?

Warning: CivilObject.SetName operation failed.
The name may exist.

This means that for at least one of the pipes the name cannot be set because it is already set to the same name. This could happen if you’ve already run the graph once to change the names, and then re-run the graph.

So, what is the best to be done to set all pipes names ?

The warning is saying that you’ve already changed all of the pipe names. If you want to change the pipe names again, you need to create a new list of different strings for the names.

1 Like

Here’s an example


Many Thanks, That’s a pretty clear explanation. It works now

In following to the same topic, I tried to do the same for the pressure networks but wasn’t able. Any help ?

What issue were you having?

Here is the script, please check it out
RenamePressureNetworksObjectsByNamingConvention.dyn (18.6 KB)

I did not have any issues, sorry. I’m not sure what the issue is on your end, but maybe it has to do with hard-coding in the number of pipes and fittings. You might end up with lists of names that don’t have the same number of items as the lists of pipes and fittings.

It would probably be more robust to get the count of the number of pipes and fittings when generating the names instead of manually entering the total number of each. That way the script would run in any scenario, such as if pipes and fittings are added or removed.


I got the error here:

it says: “Warning: PressurePipeNetwork.GetPipesFittings operation failed.
Method not found: ‘Autodesk.AutoCAD.DatabaseServices.Solid3d Autodesk.Civil.DatabaseServices.PressurePart.Get3dBody()’.”

Would you try it on this sample model and check, please

You probably need to update Civil 3D.

I’ll update it and try again

I updated the civil 3d but still doesn’t work

Sorry @MohamedR.Nasreldeen, I’m not sure of any more things to try to resolve that warning. It would be a question for @Paolo_Emilio_Serra1.

Also don’t forget to attach the log file. @MohamedR.Nasreldeen what version of c3d are you using?

1 Like

What is exactly the log files ?

@MohamedR.Nasreldeen you need to update your Civil 3D to the latest release