Message 1 of 3
dwgOutFields - filing out pointer to custom class
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I have another issue filing out data of my custom entities.
So I have a custom entity deriving from AcDbBlockReference that saves a pointer to another custom class that derives from AcDbCurve and two enum classes (lage and FmaArt).
class DLLIMPEXP PProFmaKomponente : public AcDbBlockReference {
(...)
protected:
static Adesk::UInt32 kCurrentVersionNumber ;
private:
PProGeoKante* m_pGeo;
lage m_lage;
FmaArt m_fmaArt;
(...)
//----- AcDbObject protocols
//- Dwg Filing protocol
virtual Acad::ErrorStatus dwgOutFields (AcDbDwgFiler *pFiler) const ;
virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler *pFiler) ;
//- Dxf Filing protocol
virtual Acad::ErrorStatus dxfOutFields (AcDbDxfFiler *pFiler) const ;
virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler *pFiler) ;
//----- AcDbEntity protocols
//- Graphics protocol
protected:
virtual Adesk::Boolean subWorldDraw (AcGiWorldDraw *mode) ;
(...)
} ;Now I am trying to file out these pointers using the following code and it crashes.
//- Dwg Filing protocol
Acad::ErrorStatus PProFmaKomponente::dwgOutFields (AcDbDwgFiler *pFiler) const {
assertReadEnabled () ;
//----- Save parent class information first.
Acad::ErrorStatus es =AcDbBlockReference::dwgOutFields (pFiler) ;
if ( es != Acad::eOk )
return (es) ;
//----- Object version number needs to be saved first
if ( (es =pFiler->writeUInt32 (PProFmaKomponente::kCurrentVersionNumber)) != Acad::eOk )
return (es) ;
//----- Output params
pFiler->writeAddress(m_pGeo);
pFiler->writeAddress(&m_lage);
pFiler->writeAddress(&m_fmaArt);
return (pFiler->filerStatus ()) ;
}so my questions are now:
1) can you even file out custom datatypes like enum classes and custom classes?
2) if you can do it how does it work?