CAD Exchanger SDK
Essentials

Supported Programming Languages

CAD Exchanger SDK supports C++, C# and Java programming languages. The SDK itself is written in C++ and public API for other languages is implemented via language bindings which underneath invoke C++ implementation.

The User's Guide provide documentation for C++ API. Usage for other languages can be easily derived. Available C# and Java examples can be used as a starting point.

C++ Support

When developing C++ applications make sure you select CAD Exchanger SDK libraries corresponding to the C++ compiler version which you use. Refer to the Visual Studio versions section for mapping between Visual Studio version and subfolder name in the SDK package.

C# Support

C# libraries are located in the ./csharp subfolder.

C# API is mostly aligned with C++ API. Exceptions to this rule include operators (which can't be overloaded) and setters (their names begin with Set instead of matching getters' names). C# assemblies are located in .dll's having a 'Net' suffix, for instance, CadExIGESNet.dll or CadExCoreNet.dll.

C# libraries are built using .NET Framework 3.5 what improves interoperability across Windows and .NET versions. User's applications can be built to target .NET Framework 3.5 or newer versions.

Java Support

Java libraries are located in the ./java subfolder.

Java API is mostly aligned with C++ API. Exceptions are the same as for the C# API.

When developing Java applications, in addition to Java libraries you will have to use native C++ libraries. If you already use other C++ libraries in your application you are recommended to use C++ SDK libraries consistent with your C++ compiler (i.e. vc14, vc12, etc). If you do not use any other C++ libraries then you are recommended to use C++ libraries corresponding to the latest supported C++ compiler version (e.g. vc14 on Windows).

General Conventions

Single namespace All C++, C# and Java classes are defined in the cadex namespace
C++ header file naming

Each C++ API class is defined in a header file with the same name and located in the cadex subdirectory. Thus, for instance, the header file for an IGES reader should be included as follows:

#include <cadex/IGES_Reader.hxx>
Format naming Classes that relate to a specific format have a prefix corresponding to that format (e.g. STEP_, JT_).
Converter naming Classes that perform import of CAD files (i.e. parsing and converting them into CAD Exchanger data model) have a suffix Reader (e.g. ACIS_Reader, JT_Reader), those which perform export (i.e. converting from CAD Exchanger data model and saving to a file) have a suffix Writer (e.g. STEP_Writer, Para_Writer).
Data model classes naming Classes related to CAD Exchanger data model have a prefix ModelData_ (e.g. ModelData_Part, ModelData_Body).

Release and Debug Libraries

C++ libraries are provided for both release and debug modes. The API debug libraries have suffix 'd' in their names (e.g. CadExIGESd.lib) and are located in the ./bind and ./libd subdirectories.

C# libraries (e.g. CadExCoreNet.dll) are linked to C++ libraries in release mode.

Java libraries (e.g. CadExCoreJava.jar) themselves have no distinction between release and debug modes. However native C++ libraries loaded into the Java application have to be specified inside Java code. For instance, loading a library is as follows.

For release mode:

System.loadLibrary("CadExSTEP");

For debug mode:

System.loadLibrary("CadExSTEPd");

Library linking

Using a converter from the CAD Exchanger SDK (such as IGES, Parasolid or JT converter) requires linking with a corresponding library. The name of the library can be easily derived from the format name. For instance, to add support of JT the following libraries have to be linked (for release mode):

  • C++: CadExJT.lib;
  • C#: CadExJTNet.dll;
  • Java: CadExJava.jar.

On Windows linking with SDK C++ import libraries (.lib) is done automatically when including a respective header file. For instance, including JT_Reader.hxx will automatically link with CadExJT.lib (in release mode) or CadExJTd.lib (in debug mode). This allows to avoid explicit linking (e.g. via Visual Studio project settings).

On other platforms you may need to explicitly link to the SDK libraries. Remember to link to different libraries, depending whether you build for debug or release mode.