Is there a way to detect whether a drawing was created by ODA or another application?

  1. FAQ
  2. »
  3. .dwg support

Yes. Use the exported global function declared in Drawing/Include/DbDatabase.h:

TOOLKIT_EXPORT OdString odFileWasSavedByODASoftware(const OdDbDatabase* pDb);

It returns an ODA version string for a database that was written by an ODA-based application, and an empty string otherwise. The TDFILEPRODUCT command in OdaMfcApp is a thin wrapper around it — it prints the returned string, or "Unknown" when the string is empty.