I just finished the Utilities Plugin system for DWSIM. What follows is a little Q&A to help clarify your minds:
Q) What is this plugin system?A) It is nothing more than an interface definition for add-in classes in DWSIM. You can develop a class library in any .NET language which implements the interface, compile it as a .NET DLL and copy the generated file to the plugins folder. Next time you start DWSIM, it will detect the plugin and make it available as an utility in any simulation.
Q) What information from the simulation will be available to the plugin?A) You will have the entire DWSIM Namespace available - since you're adding a reference to it - and also a reference to the active simulation and all its objects (streams, unit operations, settings, etc.). You will be able to, for example, instantiate new thermodynamic classes to do calculations, but nothing stops you from using your own class libraries, even if they are in separate assemblies (files).
Q) Ok, so what do I need to do to build a working plugin?A) The basic steps to create a plugin for DWSIM are:
1 - Create a new .NET project in your IDE of choice (Visual Studio, SharpDevelop or MonoDevelop), in any .NET language;
2 - Add a reference to
DWSIM.exe, and set the
CopyLocal property to
False (you don't have to copy the entire DWSIM application to create the plugin, just add the reference);
3 - Create a class that implements the Interface
IUtilityPlugin located in the
DWSIM.Interfaces Namespace;
4 - Implement the required methods;
5 - Compile your project as a .NET DLL;
6 - Copy the generated DLL to the
plugins folder in the DWSIM application folder;
7 - Start DWSIM and create a new/open an existing simulation;
8 - Your plugin will be available in the "Plugins" menu item.
To test the system I created an example plugin which shows some information about itself and a list of GUIDs of the objects in the active simulation. It is really easy and all you will need is some guidance on how to use DWSIM methods and access flowsheet objects and their properties.


