Share

Building the API examples on Windows

OpenModel

To build the OpenModel examples, type the following in a command prompt window and exclude any text in brackets:

mkdir examples 
cd examples
copy c:\Program Files\Autodesk\Alias2023\ODS\OpenModel\examples\Makefile .
notepad Makefile (Set ALIAS_LOCATION variable to correct path.)
vsvars32.bat (Set the Visual C++ environment variables.)
nmake copy (Copies example code into the current directory.)
nmake
 set Path=%Path%;c:\Program Files\Autodesk\Alias2023\\bin (Sets Path variable so .dlls can be found .)
.\cppCreate.exe new.wire (Run an example.)

Notes

  • You may need to change the copy path in the OpenModel example directory above depending on the location of your Aliasinstall directory. In addition, you will require the Microsoft Visual Studio bin directory to be in your path.
  • You must set the Path variable so that it includes the location of Alias bin directory so that the OpenModel .dll’s can be found.

OpenAlias

To build the OpenAlias example plug-ins, you need the following installed on your machine:

  • A compatible C++ compiler. For version 2023 that compiler is Microsoft Visual Studio 2019 VC14.2.
  • An installed copy of Alias2023.

Next you need to identify the following paths:

  • The plug-in .cpp files are located in your Alias2023 install directory under ...\ODS\OpenAlias\examples\
  • The plug-in include files (.h files) are located in your Alias2023 install directory under ...\ODS\Common\include\
  • The Makefile is located in your Alias2023 install directory in ...\ODS\OpenAlias\examples\Makefile

The program you use to run the Makefile is called nmake.exe and is located in the Visual Studio 2019 install directory.

The batch file used to set the development paths is called vcvars64.bat and is also located in the Visual Studio 2019 install directory.

Run cmd.exe to open the command prompt window then follow these steps.

  1. Set the development path by typing the following in the command prompt window. (Exclude any text in brackets.)
```
set PATH= (This clears your path to prevent the compiler from accidently finding old versions of DLLs or LIBs)
vcvars64.bat. This sets the development path to use the compiler.)

```
  1. Open the Makefile (using Notepad or any text editor) and set ALIAS_LOCATION to the Alias2023 install directory. This is usually C:\Program Files\Autodesk\.
  2. Create a new directory where you want to build the plug-ins, and copy the Makefile and example code into it.
```
mkdir <directory_name>
cd <directory name>
copy [ALIAS_LOCATION]\ODS\OpenAlias\examples\Makefile .
nmake copy

```

Note: 

If you want, you can compile the examples directly into the `...\ODS\OpenAlias\examples\ ` directory and skip this step.
  1. Add the directories listed above to your path, that is, the \examples directory, and the \include directory.
Note: 
  1. Add the \bin and \lib directories for the Alias2023 install to the path.
  2. Type the following in the command window to compile the plug-ins:
```
nmake

```

The built plug-ins can now be loaded through the Plug-in Manager.

Notes

  • You may need to change the copy path to the OpenAlias example directory above depending on the location of your Aliasinstall directory. In addition, you will require the Microsoft Visual Studio bin directory to be in your path.

Was this information helpful?