
In a previous
article, we wrote about creating cross-CAD applications from existing applications running only on the AutoCAD platform. In this article, we will delve into the details and tell you how to set up an ObjectARX project for AutoCAD and build an NRX application for nanoCAD.
Recall that in order to convert an ObjectARX application to an NRX application, you must copy the existing project configuration and replace the paths to the headers, libraries, and also set constants for conditional compilation. This process is described in the nanoCAD SDK documentation.
')
Below we will talk about what the developer’s documentation doesn’t yet have - about using property pages (property pages) to minimize the number of changes needed to create a configuration for nanoCAD in a project. As a result of the settings, the application can be assembled for both platforms, nanoCAD and AutoCAD, while the changes will be made only in the project files, the source texts, the .h and .cpp files will remain unchanged.
We start by setting the environment variable to indicate the location of the nanoCAD SDK. The variable can be defined in the system, or it can be set in the .bat file before running Visual Studio 2008.
Why Visual Studio 2008, but not 2010/2012/2013/2015?nanoCAD 3.0 - 7.0 are built on Visual Studio 2008, so applications should be built by the same compiler.
StartVS90_NCadSDK.bat: set NCadSDK=c:\Program Files (x86)\Nanosoft\nanoCAD Plus 7.0\SDK call "
After launching Visual Studio, create a new project configuration. The configuration can be created from scratch, or you can copy one of the existing configurations. For example, the Release configuration can be copied to the new NCAD Release configuration.

In order not to manually configure the parameters of the compiler and linker, let's connect the properties page, .vsprops file, in which these parameters are already configured. Property pages are added to the property manager window (View -> Property manager).

The NRX SDK includes property pages for debug and release configurations:
- rxsdk_debugcfg.vsprops - properties for the project’s debug configuration;
- rxsdk_releasecfg.vsprops - properties for the release configuration of the project;
They are located in the directory <NCadSDK_path> \ include \ arxgate. For maximum compatibility, property page files as well as headers located in the arxgate directory have the same names as similar files in ObjectARX.
After adding the property page, the following settings appear in the project:


That's all you need to do to port a simple application. The assembled NRX module is loaded into nanoCAD with the APPLOAD command. For automatic download, applications can be added to the “Startup Suitcase”, located there, in the APPLOAD command dialog.

You can also discuss the article on our
forum .
Translation of the article into English:
Porting C ++ applications to nanoCAD: using project property pages