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, tolerance=1e-09)[source]

Find the ID of a certain location.

Return type:

Optional[int]

Args:

vertex (Union[Vertex, Sequence[float]]): Vertex_xz, [x, y], (x, y) tolerance (float): Tolerance for matching existing node locations (length units). Defaults to 1e-9.

Raises:

TypeError: vertex must be a list, tuple or Vertex

Returns:

Optional[int]: 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.

Return type:

Optional[int]

Args:

dimension (str): “both”, ‘x’, ‘y’ or ‘z’ val (Union[float, Sequence[float]]): Value of the dimension.

Returns:

Union[int, None]: ID of the node.

Query node coordinates

SystemElements.nodes_range(dimension)[source]

Retrieve a list with coordinates x or y.

Return type:

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

Args:

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

Returns:

List[Union[float, Tuple[float, float], None]]: List with coordinates x or y