Converting a Drawing File to a New Type and Version
Summary
ODA Product:
Drawings SDK
Sample Name:
OdCopyEx
Categories:
C++ / Beginner Developer / Working with .dwg files / Android, iOS, macOS, Linux, Windows, WinCE, WinRT
Location:
<INSTALL_DIR>/Drawing/Examples/OdCopyEx
Description
OdCopyEx reads a drawing file and saves it as a new .dwg, .dxf, or .dxb file.
It illustrates:
Drawings SDK initialization.
File loading into a database.
Auditing of a loaded database.
Saving a database to a specified file version and type.
Assert function customization.
Run Sample Application
To run the OdCopyEx sample application, please do the following:
Open the terminal and go to the directory where the sample binary file is
built:
For Windows:
<INSTALL_DIR>\exe\<PLATFORM_NAME>\
For Non-Windows OS:
<INSTALL_DIR>/bin/<PLATFORM_NAME>/
<INSTALL_DIR> is a directory where you unpacked the
Drawings SDK archive.
To determine your <PLATFORM_NAME> parameter, please see
the ODA Platform Naming Conventions section in the
Downloading Drawings SDK topic.
The default value corresponds to the latest supported version.
OutType
A destination file type.
Can be any of:
DWG
DXF
DXB (binary DXF)
The default value is DWG.
If the application executed properly, you will see the progress of database
conversion and saving the result to the output file.
In case you get the "usage" message, check the parameters.
An error message indicates problems with the source file or target file type
and version incompatibility.