02-07-2018 02:08 AM
I spent some time to find a solution but finally I failed with a quite simple task:
The goal is to load an existing model within Python and adjust at least the filenames for one Raster Input and one Raster output operator.
Loading the model works fine:
from imagine import modeler # Load a saved model modelFile = 'e:/tmp/test.gmdx' m = modeler.Solution.Load(modelFile)
But I have found no way to set the values for Filename port the Raster Input and the Raster Outpur operator directly nor by adding two "Port Input" operators.
Reading the values is described in the online help and also works fine here:
from imagine import modeler # Load a saved model modelFile = 'e:/tmp/test.gmdx' m = modeler.Solution.Load(modelFile) for p in m.GetPorts(): print(p.name + ' = ' + str(p.data))
But I have no idea how to set the data value for the specific port. Any help is more than welcome
P.S. the used model should be attached to this post
Solved! Go to Solution.