The following is sample code for AsdkPoly::dwgInFields():
Acad::ErrorStatus AsdkPoly::dwgInFields(AcDbDwgFiler* filer) { assertWriteEnabled(); Acad::ErrorStatus es; if ((es = AcDbCurve::dwgInFields(filer)) != Acad::eOk) { return es; } // Object Version - must always be the first item. // Adesk::Int16 version; filer->readItem(&version); if (version > VERSION) return Acad::eMakeMeProxy; switch (version) { case 1: { AcGePoint3d center; filer->readPoint3d(¢er); AcGePoint3d startPoint; filer->readPoint3d(&startPoint); filer->readInt32(&mNumSides); filer->readVector3d(&mPlaneNormal); acutDelString(mpName); filer->readString(&mpName); filer->readHardPointerId(&mTextStyle); //convert data from old format acdbWcs2Ecs(asDblArray(center),asDblArray(center), asDblArray(mPlaneNormal),Adesk::kFalse); mCenter.set(center.x,center.y); mElevation = center.z; acdbWcs2Ecs(asDblArray(startPoint),asDblArray(startPoint), asDblArray(mPlaneNormal),Adesk::kFalse); mStartPoint.set(startPoint.x,startPoint.y); assert(mElevation == startPoint.z); break; } case 2: filer->readPoint2d(&mCenter); filer->readPoint2d(&mStartPoint); filer->readInt32(&mNumSides); filer->readVector3d(&mPlaneNormal); acutDelString(mpName); filer->readString(&mpName); filer->readHardPointerId(&mTextStyle); filer->readDouble(&mElevation); break; default: assert(false); } return filer->filerStatus(); }