difference between getLinkIndex and ENgetlinkid


Hi everybody!

Before all, apologies for the possibly simple question, but I’m new in EMT and this question has come up to me and I still did’nt find an answer. Here List of EPANET 2.1 Functions Supported,I looked at functions and saw that there are two types of functions, one with ID and other one with Index . (getLinkIndex and ENgetlinkid , ENgetcurveid and ENgetcurveindex ,…)
Why are two functions defined for everything? What is the difference between ID and Index?
Could someone please explain the difference between function worked with ID and function worked with Index?
Thanks in advance!


|ENgetlinkid Retrieves the ID label of a link with a specified index
|ENgetlinkindex Retrieves the index of a link with a specified ID

translate :

id یک رشته هست که نام المان رو بر میگرداند
index یک عدد است که شماره آن المان را بر میگرداند


Salam @milad-ghiami , I was glad to write to Farsi too! خیلی ممنون
What time is it better to use each one?
It depends on the type of work, isn’t it?


EPANET has 2 type elements ( links and nodes) that index and id can Belong to link or node at the same time.

index for nodes(tank,junction,reservoir ) starts from one to number of node-count that node-count is
equal to sum of junctions ,tanks and reservoirs count.

index for links(pump,valve,pipe ) starts from one to number of link-count that link-count is equal to sum of links(pump,valve,pipe ) count.

But id is name of element , for example the name of a junction element can be “junction214” but index of that can be 12 , that relate to *.inp file