Element/ node interaction

Once you structures will get more and more complex, it will become harder to keep count of element id and node ids. The SystemElements class therefore has several methods that help you:

  • Find a node id based on a x- and y-coordinate

  • Find the nearest node id based on a x- and y-coordinate

  • Get all the coordinates of all nodes.

Find node id based on coordinates

SystemElements.find_node_id(vertex)[source]

Retrieve the ID of a certain location.

Parameters

vertex (Union[Vertex, Sequence[float]]) – Vertex_xz, [x, y], (x, y)

Return type

Optional[int]

Returns

id of the node at the location of the vertex

Find nearest node id based on coordinates

SystemElements.nearest_node(dimension, val)[source]

Retrieve the nearest node ID.

Parameters
  • dimension (str) – “both”, ‘x’, ‘y’ or ‘z’

  • val (Union[float, Sequence[float]]) – Value of the dimension.

Return type

Optional[int]

Returns

ID of the node.

Query node coordinates

SystemElements.nodes_range(dimension)[source]

Retrieve a list with coordinates x or z (y).

Parameters

dimension (str) – “both”, ‘x’, ‘y’ or ‘z’

Return type

List[Union[float, Tuple[float, float], None]]