GetEndpoints()

Summary

Returns the IDs of the two endpoints of a link.

Syntax

node_ids = GetEndpoints(integer link_id)

Argument Contents
link_id The ID of a link

Returns

A two-element array of the endpoint IDs in their topological order. That is, the ID of the endpoint that appears first along the line as it was digitized occurs first in the returned array.

Notes

  • GetEndpoints() works only when the current layer is a line layer.

Example

// This macro gets a list of the endpoints for a line
SetLayer("Streets")
id = RH2ID(LocateNearestRecord(ClickCoord(), 0.25))
node_list = GetEndpoints(id)

Error Codes

Error Type Meaning
Error The current layer is of the wrong type
NotFound There is no link with this ID in the current layer

See Also

Function Summary
GetNodeLinks() Gets the IDs of links that begin or end at a node
GetLinkLayer() Gets the name of the link layer associated with a node layer
GetNodeLayer() Gets the name of the node layer associated with a link layer