The following plugin creates an AmosEngine instance (called Sem) and uses it to fit the model that is specified in Amos Graphics. Then the plugin displays the minimized value of the discrepancy function.
Imports Microsoft.VisualBasic
Imports Amos
<System.ComponentModel.Composition.Export(GetType(IPlugin))>
Public Class CustomCode
Implements IPlugin
Public Function Mainsub() As Integer Implements IPlugin.Mainsub
Dim Sem As New AmosEngineLib.AmosEngine
pd.SpecifyModel(Sem)
'The Amos engine now has the model specification,
'but the model has not yet been fitted.
'Fit it now using the Amos Engine (not Amos Graphics)
'and display the discrepancy function.
Sem.FitModel()
MsgBox(Sem.Cmin)
Sem.Dispose()
End Function
Public Function Name() As String Implements IPlugin.Name
End Function
Public Function Description() As String Implements IPlugin.Description
End Function
End Class