Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
h2.
scrollbar

Exercise

...

outline

...

We

...

want

...

to

...

load

...

our

...

ivory

...

coast

...

model

...

or

...

our

...

harlingen

...

model

...

using

...

a

...

mdu

...

file.

Import a model from a mdu file

Start by creating a new script in the toolbox scripting folder (see Toolbox overview for details), and double click it to open the scripting editor and add the following code :

Code Block
languagepython



h2. Import a model from a mdu file

Start by creating a new script in the toolbox scripting folder (see [TOOLS:Toolbox overview] for details), and double click it to open the scripting editor and add the following code :

{code:language=python}
#region Import libs

# DeltaShell libs
from DeltaShell.Plugins.FMSuite.FlowFM import WaterFlowFMModel

#endregion

rootPath = "D:\\scripting\\"

# create fm model using mdu file
fmModel = WaterFlowFMModel(rootPath + "mdu_ivoorkust\\ivk.mdu") #"harlingen\\har.mdu" for harlingen)

{code}

\\

In the first statements we import the WaterFlowFMModel from the DeltaShell code ( in module (namespace) 


In the first statements we import the WaterFlowFMModel from the DeltaShell code ( in module (namespace) DeltaShell.Plugins.FMSuite.FlowFM

...

),

...

and

...

add

...

the

...

#region

...

-

...

#endregion

...

comments

...

to

...

mark

...

this

...

block

...

of

...

code

...

as

...

a

...

collapsable

...

region.

...

After

...

we

...

run

...

this

...

code

...

the

...

editor

...

will

...

now

...

know

...

about

...

WaterFlowFMModel

...

and

...

you

...

can

...

use

...

it

...

in

...

your

...

scripts.

{:=
Code Block
language
python
}
#region Import libs

# DeltaShell libs
from DeltaShell.Plugins.FMSuite.FlowFM import WaterFlowFMModel

#endregion


With the following code we create a new WaterFlowFMModel object using the path to the mdu file :

Code Block
languagepython
{code}

\\

With the following code we create a new WaterFlowFMModel object using the path to the mdu file :


{code:|language=python}
rootPath = "D:\\scripting\\"

# create fm model using mdu file
fmModel = WaterFlowFMModel(rootPath + "mdu_ivoorkust\\ivk.mdu") #"harlingen\\har.mdu" for harlingen)
{code}
\\
\\



scrollbar