web
You’re offline. This is a read only version of the page.
close
Views:

Symptom

Running a script for Scenario Management addressing Scenario attributes fails with an error message:

“IScenarioManagement::CurrentProject failed: No project is open on a computing node during the the procedure. To query information from the project, procedure variables can be used.”

How can I use Scenario attributes like Name or Code from a Python script that uses the Scenario Management?

Cause

Due to the different scopes this is not directly possible: The Visum instance running the Scenario Management cannot share data with a Visum instance opened with one Scenario.

Solution

There is a way to achieve this:
- In the Scenario Management, in its tab "Procedure parameter sets", edit the Procedure parameter set used in the Scenarios.
- In Calculate -> Procedure variables -> Definitions
add a Procedure Variable like "ScenNo".
- Finish the edit mode.
- In the tab "Scenarios" this variable is listed like any other Scenario attribute, you can even add it together with Number and Code. Use this to copy&paste values like in Excel.
- When opening one Scenario, you'll find its respective value in:
Calculate -> Procedure variables -> Values
- In the Procedure "Edit attribute" this is accessible through:
Network object type: OperationVariables
Target attribute: ScenNo
- In a script this is accessible through:

myScenNo = Visum.Procedures.OperationVariables.GetOperationVariable("ScenNo")
myScenNo.ValueOfVariable