EPANET  2.1
Network Info

Functions

int ENgetcount (int code, int *count)
 Retrieves the number of components of a given type in the network. More...
 
int ENgetnodeindex (char *id, int *index)
 Get index of node with specified ID. More...
 
int ENgetnodeid (int index, char *id)
 Get the string ID of the specified node. More...
 
int ENgetnodetype (int index, int *code)
 Get the type of node with specified index. More...
 
int ENgetnodevalue (int index, int code, EN_API_FLOAT_TYPE *value)
 Get a property value for specified node. More...
 
int ENgetcoord (int index, EN_API_FLOAT_TYPE *x, EN_API_FLOAT_TYPE *y)
 Get coordinates (x,y) for a node. More...
 
int ENsetcoord (int index, EN_API_FLOAT_TYPE x, EN_API_FLOAT_TYPE y)
 Set coordinates (x,y) for a node. More...
 

Detailed Description

Function Documentation

int ENgetcoord ( int  index,
EN_API_FLOAT_TYPE *  x,
EN_API_FLOAT_TYPE *  y 
)

Get coordinates (x,y) for a node.

Parameters
indexThe index of a node (first node is index 1).
[out]xX-value of node's coordinate
[out]yY-value of node's coordinate
Returns
Error code
See also
ENsetcoord
int ENgetcount ( int  code,
int *  count 
)

Retrieves the number of components of a given type in the network.

Parameters
codeComponent code (see EPANET2.H)
[out]countNumber of components in network
Returns
Error code
int ENgetnodeid ( int  index,
char *  id 
)

Get the string ID of the specified node.

Parameters
indexThe index of the node (first node is index 1)
[out]idThe string ID of the specified node. Up to MAXID characters will be copied, so id must be pre-allocated by the calling code to hold at least that many characters.
Returns
Error code
See also
ENgetnodeindex
int ENgetnodeindex ( char *  id,
int *  index 
)

Get index of node with specified ID.

Parameters
idThe string ID of the node
[out]indexThe node's index (first node is index 1)
Returns
Error code
See also
ENgetnodeid
int ENgetnodetype ( int  index,
int *  code 
)

Get the type of node with specified index.

Parameters
indexThe index of a node (first node is index 1)
[out]codeThe type code for the node.
Returns
Error code
int ENgetnodevalue ( int  index,
int  code,
EN_API_FLOAT_TYPE *  value 
)

Get a property value for specified node.

Parameters
indexThe index of a node (first node is index 1).
codeThe property type code
[out]valueThe value of the node's property.
Returns
Error code
See also
EN_NodeProperty
int ENsetcoord ( int  index,
EN_API_FLOAT_TYPE  x,
EN_API_FLOAT_TYPE  y 
)

Set coordinates (x,y) for a node.

Parameters
indexThe index of a node (first node is index 1)
xX-value of node's coordinate
yY-value of node's coordinate
Returns
Error code
See also
ENgetcoord