Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
We start by creating the basic network (consisting of branches and nodes) using the "network_Branches.shp" shape file.
The fist thing we have to do is declare where the shape and csv files are located :
Code Block | ||||
---|---|---|---|---|
| ||||
rootPath = r"D:\Workshop\data" |
For this we will need to use a library called "SOBEKTutorialLibrary" in the "Libraries" folder of the toolbox. This is done by adding the following line (and running it).
Code Block | ||||
---|---|---|---|---|
| ||||
from Libraries.SOBEKTutorialLibrary import * |
This will make all the functions (because of the *) in the "SOBEKTutorialLibrary" library available for use. All these functions will now also appear in the code completion dialog (when you use ctrl + space).
In this library we have a function called "CreateNetworkFromBranchShapeFile" which we will use to create the basic network.
Code Block | ||||
---|---|---|---|---|
| ||||
network = CreateNetworkFromBranchShapeFile(rootPath + r"\network_Branches.shp") |
After running this line the model is imported and added to the variable "hydroModel", but we can not see the model yet