The Analytica Decision Engine Tutorial

Revision as of 17:58, 8 May 2015 by Karenlee (talk | contribs) (Created page with "ADE User Guide > The Analytica Decision Engine Tutorial This tutorial shows you how to use the Analytica Decision Engine (ADE) from within a Visual Basic program. ==...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

ADE User Guide > The Analytica Decision Engine Tutorial

This tutorial shows you how to use the Analytica Decision Engine (ADE) from within a Visual Basic program.

Your first ADE application

First let’s write a simple ADE application from scratch, just to be sure that everything is set up correctly. Follow these steps:

  1. Bring up Visual Studio.NET.
  2. Select New Project, then select the Project Type “Visual Basic Projects” and the template “Console Application.” Select a project name, e.g., “FirstADEtry,” and an appropriate folder location.
  3. From the Project menu, select Add Reference and select the COM tab in the dialog. Find and select Analytica Decision Engine Local Server 4.6 (Ade.exe) and click OK.
    • Note: If you have installed ADE 64-bit and do not have ADE 32-bit installed, Visual Studio may not show Analytica Decision Engine Local Server 4.6, even though it is properly installed. This occurs because Visual Studio itself is a 32-bit application. If this happens, select the Browse tab on the Add Reference dialog, navigate to the ADE install directory (usually C:\Program Files\Lumina\ADE 4.6), and select ADE64.exe.
    • Note: If you cannot find this entry in the list of COM servers, then ADE 4.6 is not properly installed. See Installation of ADE for instruction on how to install ADE before reading further.
  4. Add to the Module1 class as follows:

Imports ADE
Module Module1
Public ADE As CAEngine
Sub Main()
Dim FileName, ModelName As String
FileName = "C:\Program Files\Lumina\Analytica 4.6"
FileName &= "\Example Models\Tutorial Models\Car Cost.ana"
ADE = New CAEngine
ADE.MonitorProcess( System.Diagnostics.Process.GetCurrentProcess().Id )
ModelName = ADE.OpenModel(FileName)
If ModelName = "" Then
Console.Write(FileName & " not found")
Else
Console.Write("Congratulations on opening ")
Console.WriteLine(ModelName)
Console.WriteLine("Press 'enter' to exit")
Console.ReadLine()
End If
End Sub
End Module
Comments


You are not allowed to post comments.