Page 1 of 1

Accessing model variables in an ActiveX component

Posted: Fri May 23, 2014 10:24 am
by Herve - IPSIS
Hello,

I tried the ActiveX sample project with C-Roads and got some troubles in accessing model variables :
Before launching a simulation run, I can get and set any value.
After having run the simulation, I can only read, but not set any value.

Here are the steps to reproduce the problem :
  • 1) Add the ActiveX sample VBDemoControl to C-Roads sable project (using the files stored in
    MODEL.zip
    (234.78 KiB) Downloaded 674 times
    )
    2) Open C-Roads project in Sable developper
    3) Open the VBDemoControl window
    4) Create a new run with aggregation value "15 Region"
    5) Using the VBDemoControl window, set the following values :
    • Pct change in FF emissions sable[China] = -50
      ff change target year ecr sable[China] = 2030
      ecr target by rs sable[China] = 2
    6) In the VBDemoControl window, click "Sim Run"
    => The simulation runs, the CO2 FF emissions of China decrease
    7) Using the VBDemoControl window, set now the following value :
    Pct change in FF emissions sable[China] = +30
    => The value is not set. Pct change in FF emissions sable[China] value is still -50

Re: Accessing model variables in an ActiveX component

Posted: Fri May 23, 2014 12:48 pm
by Administrator
Can you email the entire project to me? I cannot figure out what is wrong with just the OCX to use.

Re: Accessing model variables in an ActiveX component

Posted: Fri May 23, 2014 12:58 pm
by Herve - IPSIS
Hello,

I got it working : C-Roads scripts reinitialize the SYNTHESIM mode. I called the same Venapp commands from my OCX and could modify values after a simulation run :

SYNTHESIM>AUTO|0
SYNTHESIM>AUTO|1
SYNTHESIM>GO|
SetData(data, value)
SimRun()

Hervé