Use VBA code link with epanet2.dll to change IDs

Dear All, Please How can Node and Pipe IDs of a Inp file be changed to new IDs. Thanks

Currently there are no API functions to change Nodes and links IDs

I suggest you open the .inp file itself in code and change the IDs before saving it under the same or a different name.

Thanks, Please what do you mean by “API”?.

Thanks kobusvanzyl, do you mean manually change IDs, if yes. In my case I have a network, it has large number of nodes and pipes, it takes too much time to change all the IDs.

The APIs (Application Programming Interface) are the of functions exposed in epanet2.dll. You can find them in the Wiki.

I think what @kobusvanzyl meant was not to change the IDs manually but to write some code that will change them.

Thanks eladsal, Now, I am using VBA codes, and call epanet2.dll codes in the tookit package. I have used the following code to retrieve link IDs and it works.
"Public Function getLinkId(ByVal Index As Long) As String
Dim s As String
s = String$(255, vbNullChar)
error = ENgetlinkid(Index, s)
getLinkId = Left(s, InStr(1, s, vbNullChar) - 1)
End Function "

But what Public Function can be used to set new link and node IDs?.

@karwan_eng as I wrote in my first response, there is no function to change the IDs of nodes and links - sorry.

You may follow the option @kobusvanzyl suggested.