Skip to main content
Add a node to the structural model at specified coordinates.

Syntax

model.add_node(id, x, y)

Parameters

id
int
required
Unique identifier for the node. Node IDs must be sequential and ordered (1, 2, 3, …).
x
float
required
X-coordinate of the node in the global coordinate system.
y
float
required
Y-coordinate of the node in the global coordinate system.

Returns

Returns a Node object representing the created node.

Raises

  • ValueError: If a node with the same ID already exists.

Example

import milcapy as milca

# Create a model
model = milca.SystemMilcaModel()

# Add nodes to the model
model.add_node(1, 0.0, 0.0)    # Node at origin
model.add_node(2, 5.0, 0.0)    # Node at x=5
model.add_node(3, 5.0, 3.0)    # Node at x=5, y=3
model.add_node(4, 0.0, 3.0)    # Node at y=3
Node IDs must be sequential and ordered (1, 2, 3, …). Non-sequential IDs may cause errors in the analysis.

Build docs developers (and LLMs) love