![]() |
【转帖】problem reading textstyle
problem reading textstyle
problem reading textstyle hi, i use following code to read textstyle of the attached file: oddbdimstyletablerecordptr ptroddimstyle; //1line ...... oddbhardpointerid txtstyleid = ptroddimstyle->dimtxsty(); //2line oddbtextstyletablerecordptr ptrtextstyle = txtstyleid.openobject();//3line ...... when running to 3line(above), the program throws a exception "not that kind of class". why? whether there are some problem in my code or the file has wrong information? btw, acad can open this file. attached files in the file attached dimension style standard has incorrect text style reference which points not to text style but to dimstyletable. so the pointer (to dimstyletable) can't be cast to text style pointer. you can use: code: oddbobjectid txtstyleid = ptroddimstyle->dimtxsty(); oddbobjectptr ptrobj = txtstyleid.openobject(); oddbtextstyletablerecordptr ptrtextstyle = oddbtextstyletablerecord::cast(ptrobj); if (ptrtextstyle.isnull()) .... btw, dwgdirect's recover finds and fixes this problem. sergey slezkin thanks, sergey. it works now. |
所有的时间均为北京时间。 现在的时间是 03:38 PM. |