Filing Objects to DWG and DXF Files

When deriving a class from AcDbObject, you need the additional information on the AutoCAD filing mechanism provided in this chapter. The following four functions are used for filing objects to DWG and DXF files. They are also used for other purposes, such as cloning.

Acad::ErrorStatus 
AcDbObject::dwgOut(AcDbDwgFiler* pFiler) const;
 
Acad::ErrorStatus 
AcDbObject::dwgIn(AcDbDwgFiler* pFiler);
 
Acad::ErrorStatus 
AcDbObject::dxfOut(
    AcDbDxfFiler* pFiler,
    Adesk::Boolean allXdFlag,
    Adesk::uchar* regAppTable) const;
 
Acad::ErrorStatus 
AcDbObject::dxfIn(AcDbDxfFiler* pFiler);

Each function takes a pointer to a filer as its primary argument. An AcDbObject writes data to and reads data from a filer. The FilerType enum allows you to check the filer type. Filer types are

The dwgOut() and dwgIn() functions in turn call dwgOutFields() and dwgInFields(), respectively, and the DXF filing functions call an analogous set of functions for DXF. If you are deriving a custom class from AcDbObject, you will need to override the following virtual functions, which are used for persistent storage of objects as well as for copying and undo operations: