set_pipe_diameter
Update a pipe's diameter in an EPANET network, validating the change against engine rules. Invalidates prior simulation results, so re-run the simulation afterward.
Instructions
Change the diameter of a pipe in a loaded network. The edit is validated against the EPANET engine before it is applied: the pipe must exist and be a pipe, the value must be within realistic bounds for the model's units, and the edited model must re-parse with the requested diameter. Previous simulation results for the network are invalidated (they describe the old model) — re-run run_simulation afterwards.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| linkId | Yes | Id of the pipe to resize (use get_links to list pipe ids). | |
| diameter | Yes | New diameter in the model's native units (mm for SI models, inches for US-unit models). Realistic bounds are enforced: 1–10000 mm or 0.01–400 inches. | |
| networkId | Yes | The network id returned by load_network. |