Drawings SDK Developer Guide > Working with .dwg Files > Working with Other File Formats > Exporting to Other Formats > Exporting to a Collada (.dae) File
Exporting to a Collada (.dae) File

Drawings SDK supports exporting a .dxf, .dwg, or .dgn file to a Collada format file (.dae file) and importing a Collada file into a .dwg or .dxf file. The export and import modules are single support modules for the Drawings SDK, and they are available in dynamic and static forms for Windows, Linux, and macOS (x86 and x64 versions). All source is available in the release packages.

The following components are available:

  • OpenCollada SDK — Currently using COLLADABaseUtils, COLLADAStreamWriter, libBuffer, pcre, UTF.
    Location: ThirdParty\openCOLLADA\.
    More information about Collada is at http://opencollada.org/.
  • TD_ColladaExport.tx — A .tx support module for Collada export.
    Location: Kernel\Exports\ColladaExport\
    This module should be loaded by the user application to get access to Collada export functionality. The main exported class is “ColladaModule”.
  • Collada export example application — Contains sample call code for .dwg files.
    Location: Drawing\Examples\OdColladaExport\
  • Collada export example application for .dgn files — Contains sample call code for .dgn files.
    Location: Dgn\Examples\ExDgnColladaExport\
  • TD_ColladaImport.tx — A .tx support module for Collada import.
    Location: Drawing\Imports\ColladaImport\
    This module should be loaded by the user application to get access to Collada import functionality.
  • Collada import example application — Contains sample call code for .dwg files.
    Location: Drawing\Examples\OdColladaImportEx\

Collada Export

Supports exporting the geometry of 3D objects, lights, and materials.

There are two methods available.

The first method exports all entities in the active space of pDb to a file with the filename provided in pFileName:

 virtual OdResult exportCollada(OdDbBaseDatabase *pDb, const OdString& pFileName, const ODCOLORREF* pPallete, int numColors = 256);

The second method exports a single entity defined by pEntity of pDb to a file with the filename provided in pFileName. The color palette used with export should be posted via pPallete and numColors. This method is used for setting up the correct pallete for an export device:

 virtual OdResult exportCollada(OdDbBaseDatabase *pDb, const OdGiDrawable &pEntity, const OdString& pFileName, const ODCOLORREF* pPallete, int numColors = 256);

Example application

The command line format for the sample applications is:


usage: ExDgnColladaExport <input file> <output file>
      <input file>  - .dgn file
      <output file> - .dae file

usage: OdColladaExport <input file> <output file>
      <input file>  - .dxf or .dwg file
      <output file> - .dae file

Collada Sample Files and Viewing Applications

Here you can find free Collada sample files:

For viewing .dae files you can use Collada viewing applications, for example Blender.

See Also

Working with Other File Formats

Importing Collada (.dae) Files

Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.