Please enable JavaScript to view this site.

Vensim Help

Navigation: Reference Guide > DSS Supplement > Vensim DLL

Available DLL Functions

Scroll Prev Top Next More

For details on all the functions see the alphabetical listing in DLL Function Details.


Commands and Output

vensim_command, vensim_tool_command, vensim_show_sketch

The Vensim DLL is used by passing commands to control loading of models and simulation.  The majority of the work is done using the vensim_command function and its counterpart vensim_tool_command when there is visual output.  The vensim_show_sketch function allows you to present model sketches to the user.  Use the vensim_tool_command with the PRINT and EXPORT commands to print and place things into the clipboard.


Simulation Control

vensim_start_simulation, vensim_continue_simulation, vensim_finish_simulation

Simulation can be performed by passing the MENU>RUN command to Vensim.  An alternative is to use the vensim_start_simulation, vensim_continue_simulation and vensim_finish_simulation commands in order to perform a simulation bit by bit.  This allows you to provide the user feedback on simulation progress.  If you do not use these commands, Vensim will perform the entire simulation before returning control to your program and this can be time consuming.  

NOTEIt is not possible to perform optimization or sensitivity simulations using these commands.


Data Access

vensim_get_data, vensim_get_dpval, vensim_get_dpvecvals, vensim_get_sens_at_time, vensim_get_val, vensim_get_varoff, vensim_get_vecvals

The vensim_get_data function is used to retrieve data from simulation output and converted data files.  The vensim_get_val (vensim_get_dpval for double precision) is useful for retrieving information during the progress of a simulation or while gaming is going on.  You can call vensim_get_vecvals (vensim_get_dpvecvals for double precision) to get a number of values at once with offsets as determined by vensim_get_varoff.    The vensim_get_sens_at_time function retrieves the results of sensitivity simulations.


Structure Access

vensim_get_varattrib, vensim_get_varnames

The vensim_get_varnames function can be used get the names of variables in the model.  The vensim_get_varattrib function can then be used to retrieve attributes including causes, uses, comments, subscript and equations.  




vensim_be_quiet, vensim_check_status, vensim_get_substring, vensim_get_info, vensim_set_parent_window

The vensim_be_quiet function allows you to shut off the visual work in progress elements that Vensim displays during simulation and some other activities.  The vensim_check_status function allows you to determine the internal state Vensim is in (simulating, gaming or idle).  The vensim_get_info function lets you get information about the current model, loaded runs, available tools and so on.  The vensim_set_parent_window allows you to specify a parent window for dialog boxes and other prompts the Vensim DLL brings up.  The vensim_get_substring function is a utility function designed to make it easier to work with strings in Visual Basic.