SplitNode()

Summary

Splits an endpoint (node) into one node for each line that is connected to it.

Changes

Integer IDs of the lines associated with the endpoints added to the return array in Version 5.0.

Syntax

node_ids = SplitNode(integer ID, array options)

Argument Contents
ID The ID of the endpoint to split
Option Type Contents
Reason String If provided, a record will be added to the database's log file, with this used as the Reason column. If it's not provided, no entry will be added, even if the other options are present.
Comment String Text for the comment field of the log file.
User String User name for the log file.

Returns

An array containing the integer IDs of the original endpoint and the new endpoints, and the integer IDs of the lines associated with those endpoints.

Notes

  • SplitNode() can only be used on the endpoint layer of a standard geographic file.

  • The endpoint layer must be the current layer.

  • If fewer than two line features are connected to the endpoint, a copy of the endpoint is created.

  • The original endpoint is kept, and its ID is returned as the first element of the node_ids array.

  • If two or more line features are connected to the endpoint, the number of new endpoints is equal to the number of lines entering the node minus one.

  • The log file name will have the same name as the database and a .txt extension.

Example

// Split a Node where the user clicks
SetLayer("Xsection")
id = RH2ID(LocateNearestRecord(ClickCoord(), 0.25))
ids = SplitNode(id)

Error Codes

Error Type Meaning
Error The current layer is not an endpoint layer, or is not from a standard geographic file
NotFound There is no feature with the given ID

See Also

Function Summary
AddNode() Adds an endpoint to a standard geographic file
MoveNode() Changes the location of an endpoint feature in a standard geographic file
DeleteNode() Deletes an endpoint feature from a standard geographic file