C_RunSimulation

Note: C_RunSimulation has been superseded by C_RunSimulation2. We recommend that any new code you write uses C_RunSimulation2.

Call C_RunSimulation to run an OrcaFlex simulation. This function is the equivalent of selecting Calculation | Run simulation from the OrcaFlex menu.

void C_RunSimulation(

TOrcFxAPIHandle ModelHandle,

TDynamicsProgressHandlerProc DynamicsProgressHandlerProc,

int *lpStatus

);

Parameters

ModelHandle (IN)

The handle of the model.

DynamicsProgressHandlerProc (IN)

A callback function to handle progress notifications. If you do not want to receive progress notification pass NULL.

lpStatus (OUT)

Points to a variable in which the status result for the function call will be returned.

Remarks

The model must be in the correct state (either msInStaticState or msSimulationStopped) before calling C_RunSimulation. To find out what state the model is you can call C_GetModelState.

The model will be in state msInStaticState immediately following a successful call to C_CalculateStatics. Following successful calls to C_ExtendSimulation or C_LoadSimulation the model will be in state msSimulationStopped.

If the simulation goes unstable then the simulation will be aborted. When this happens C_RunSimulation exits and returns stOK for the status and the model is placed in state msSimulationStoppedUnstable. You should test the model state by calling C_GetModelState.

See also

C_CalculateStatics, C_ExtendSimulation, C_GetModelState, C_LoadData, C_LoadSimulation, C_RunSimulation2, C_SaveData, C_SaveSimulation.