Please enable JavaScript to view this site.

IBM® SPSS® Amos™ 28

This section shows how to use Visual Studio 2015 to write an Amos plugin in Visual Basic. The plugin created here will draw two observed variables called ThingOne and ThingTwo.

1.(You only have to do this once.) Install Visual Studio 2015.  You can use any edition of Visual Studio 2015, including the free Visual Studio Community 2015.
 

2.(You only have to do this once.) Double-click the file Amos.VSIX in the Amos program folder. This installs Visual Studio templates that give you a head start in writing Amos programs.
 

3.Open Visual Studio and click File > New Project.
 

4.In the New Project dialog, select Visual Basic and then Amos  XX Plugin, where XX is the version of Amos you want to use.
 
PluginNewProject
 
You can enter your own values for Name, Location and Solution name, or just accept the default values.
 

5.Click OK to close the New Project dialog.
 

6.View Module1 by clicking Module1 in Solution Explorer.
 
PluginModule1

 

7.Add code to the functions Name, Description and MainSub as shown in the following figure.
 
PluginModule1_a
 
Amos calls the Name function to obtain the name of the plugin. Amos puts this name on the Amos Graphics Plugins menu. In the present example Two Observed Variables will be placed on the Plugins menu. It is OK for the Name function to return an empty string (""). In that case, the Plugins menu will display the name of the file in in which you save the plugin.
 
Amos calls the Description function to obtain a description of the plugin. A plugin's description is typically longer than its name. A plugin's description is displayed when the plugin is selected from the list in the Plugins dialog. It is OK if the Description function returns an empty string ("").
 
Amos will call the MainSub function (in other words, it will draw two variables called ThingOne and ThingTwo) when you select Two Observed Variables from the Plugins menu.
 
In this example, only the name of each new observed variable is specified. You can also specify the location and size of the rectangle that represents an observed variable, and you can place constraints on the variable's mean and variance. See the Observed Method for more details.
 

8.Create the plugin by clicking Build > Rebuild Solution.
 

9.To test the plugin, click Plugins on the Amos Graphics main menu. The Plugins menu will contain the entry Draw Observed Variables.
 
PluginsMenuTwoObservedVariables
 

10.  Click Plugins > Two Observed Variables to draw the new variables
 
PluginScreenShotThingOneAndthingTwo

© 2021 Amos Development Corporation