Nodes#
- class Nodes(model)[source]#
Node Iterator Methods.
- Parameters:
model (object) – Open Model Instance
Examples:
>>> from pyswmm import Simulation, Nodes >>> >>> with Simulation('tests/data/model_weir_setting.inp') as sim: ... for node in Nodes(sim): ... print(node) ... print(node.nodeid) <swmm5.Node object at 0x031B0350> J1 <swmm5.Node object at 0x030693D0> J2 <swmm5.Node object at 0x031B0350> J3 <swmm5.Node object at 0x030693D0> J0
Iterating over Nodes Object
>>> nodes = Nodes(sim) >>> for node in nodes: ... print(node.nodeid) J0 J1 J2 J3
Testing Existence
>>> nodes = Nodes(sim) >>> "J1" in nodes True
Initializing a node Object
>>> nodes = Nodes(sim) >>> j1 = nodes['J1'] >>> print(j1.invert_elevation) 12 >>> >>> j1.invert_elevation = 200 >>> print(j1.invert_elevation) 200
Methods