After confirming with ok, there are more options of the
application-assistent, but we don't have to change anything here and we
can click on finish.

After were again in the main window, we have to make some adjustements to reference the path for the includes and libraries of the AM SDK. This is done with project-options .
At first we choose the C/C++ page, on this page praeprocessor and
all definitions and we add the path of the AM SDK-includes to
additional include-directories. The easiest way is to use relative
path-addresses, in the example: ..\..\..\include .

Now we have to change the extension of the file, which will be
created, into .hxt and to set the libraries of the SDK, which will be
linked to our project. This configuration is made on the "Linker"-page.
At first for the debug-version

And for the release-version

It's important to make sure, that both versions are created in
different directories (again relative path) and that both
file-extensions are changed to .hxt.
These are the necessesary configuration options for the project.
Now we go to the main window.
For the description, which will be visible in the menu in A:M, we
create a string ressource with Insert->Ressource
.

Here the string table is to be chosen and created with New
Now we set on the first entry IDS_STRING1 the menu name.

It's important to use the ID of the string (here: ID_STRING1) if the
name of the menu is added to the menu in the function
HxtOnAddCommandMenu in entry.cpp.
Next we create a simple dialog with Insert->Ressource
Dialog .

Now we have our simple dialog.
And we create with the class-assistent a new class for this dialog.

Here we choose a new class and give it in the next step the name
sample_dialog.

Now the frame for our project is ready. Following is the actual coding
for which it would be useful to take a look on the source of the example
project.
At first a new C++-source file has to be added to the project. We call
it entry.cpp. In this file
are the functions for initialization: HxtLoadCommandEntry
(determines which type of object AM should create, definitions are in
includes\objtype.h), HxtOnAddCommandMenu
(determines the name of the plugin as shown in the menu and the type of
the plugin),
and HxtOnCommand (the function, which is
executed after calling the plugin).
It's important to check, if all includes are set. The easiest way is to
copy the functions out of the sample source code into your project.
Now we have to do some changes in sample.h.
We insert the following includes
#include "SDK\HPropert.h"
#include "SDK\HPropDri.h"
#include "SDK\HPatch.h"
#include "SDK\HModel.h"
And the classes
class HModelCache;
class HGroupCP;
And the function
BOOL OnSampleWizard(HModelCache *hmc);
at least
virtual BOOL InitInstance();
virtual int ExitInstance();
(The place where to put these insertions you could find in the source
code file sample.h :-))
The new functions now have to be fleshed out of course and this happens
in
sample.cpp. I only mention the most important function in this
tutorial: OnSampleWizard .
BOOL CSampleApp::OnSampleWizard(HModelCache *hmc)
{
sample_dialog dlg(NULL); //creation of the dialog
if (dlg.DoModal()!=IDOK)
return TRUE;
return TRUE; //here is otherwise the function,
which does the work;
//in the example project the function does nothing
//so: return TRUE
//in a real project it could be: return NewShape(hmc),
as shown in Grid\HXT.cpp Grid\evalute.cpp
}
That's all. After pressing F7 the example project should be compiled
without any problem. If there are problems, you better compare your
code with the sample code provided here. Mostly forgotten includes are
responsible for problems. After successfull compiling copy the file
sample.hxt in the AM HXT directory and after a new start of AM the
plugin should be visible if a object or model is selected.
To see how to make something useful with the plugin, you have to study
the sources of the example plugins of the SDK. Personally I found the
grid-plugin the most helpful; also it's the model for my first plugin.
My second minitutorial
shows how to debug such a plugin.