![]() |
【转帖】problem reading subentities in dwginfields
problem reading subentities in dwginfields
problem reading subentities in dwginfields hi, we have created our own custom entity in autocad (dbx). saving and loading of a drawing with those entities goes great. but we also created a drx file to read the entities within our own viewer created with dwgdirect. and it crashes reading the subentities of our custom entity. this is what we are trying to do: odresult courcustom::dwginfields(oddbdwgfiler* pfiler) { assertreadenabled () ; //----- read parent class information first. odresult es = oddbentity::dwginfields (pfiler) ; if ( es != eok ) return (es) ; //----- object version number needs to be read first int version = pfiler->rdint32(); //wrong version if ( version > courcustom::lastknownversion ) return (emakemeproxy) ; //----- odint16 ifirstint = pfiler->rdint16(); odint16 isecondint = pfiler->rdint16(); odint16 ithirdint = pfiler->rdint16(); /// this is where the unhandled exception comes: // reading the data that belongs to a lwpolyline es = m_dbpolyline.dwginfields(pfiler); return (pfiler->filerstatus ()) ; } it crashes in the function oddbdatabase::getmodelspaceid( ). my guess is it is because of that m_dbpolyline hasn't been added to the database. but what to do about it? does someone knows a solution? thanks in advance yes, the problem is that dwginfields needs to know database of the entity. try to call m_dbpolyline.setdatabasedefaults() before calling dwginfields(). sergey slezkin |
所有的时间均为北京时间。 现在的时间是 08:18 PM. |