DWG import using Teigha

REDsdk delivers a free auxiliary module with source code that can be used to connect REDsdk with the Teigha framework from the Open Design Alliance (www.opendesign.com).

The REDOdadevice setup installs a project for Visual Studio 2012 that can be used to recompile and use a Teigha vectorization device.

The current version of Teigha used by the REDOdaDevice is 4.01. Some easy compilation fixes may be requested to run the device on another version of Teigha.

Installing the REDOdaDevice

The REDOdaDevice setup will ask you to locate Teigha.

The REDOdaDevice will require you to indicate two folders to it:

Please make sure that the two folders are properly selected. Otherwise, files will not be properly copied into the installation folder of the REDOdaDevice.

Please also note that the current version of the REDOdaDevice does not embed Linux and MacOS versions of Teigha.

Using the REDOdaDevice

From the Windows start menu (if you have already left Windows 8 for Windows 10 ;-)), please select the OdaMFCApp.exe, or access the executable directly from the installation folder / BuildImage / Win32 (or Win64 for the x64 version).

On launching the OdaMfcApp, after loading a .DWG file, please select the REDOdaDevice_4.01_11.txv vectorization device:

Launching the REDOdaDevice for the vectorization of a .DWG file.

Then, enjoy the REDOdaDevice! But, please make sure that the GS model option is checked. See below for details.

Using the GS model (geometry cache)

The device is using the geometry cache to avoid re-creating geometries that exist already each frame. This is a must have that is enforced at the device initialization phase. If the corresponding option is not enabled in the application, the device will refuse to start (OdaMfcApp / Tools / Options / Use GS Model (geometry cache) must be checked).

Recompiling the REDOdaDevice

The REDOdaDevice.sln, which is a Visual Studio 2012 solution, can be used to recompile the device. Recompiling will fail because of two undefined symbols; REDSDK_CUSTOMER_CODE and REDSDK_LICENSE_KEY:

if( rc != RED_OK )
  DisplayError( ROD::RC_REDSDK, rc );
  return RED_FAIL;

These need to be replaced by your own customer code and license key if you own a software vendor license, or by a call to RED::ILicense::SetOnlineLicense if you own a seat based license. In any case, a valid license key is required here. Please refer to Licensing for details on how to setup a license.

The pre-compiled REDOdaDevice_4.01_11.txv device owns a license key, so it can be used without having to enter any licensing information.

Overview of the REDOdaDevice

This documentation section will detail the REDOdaDevice architecture a bit further. We'll find: