![]() |
【转帖】undo On Entity Fields
undo on entity fields
undo on entity fields hi, i am trying change end points of line. and then try to undo it. is this supported? example code is as follows: getoddbdatabase()->startundorecord(); pnewline->setstartpoint(ptstart); pnewline->setendpoint(ptend); id = pspace->appendoddbentity(pnewline); //this change gets undone getoddbdatabase()->startundorecord(); pline = id.safeopenobject(oddb::kforwrite); pline->setstartpoint(ptnewstart); //this change doesn't get undone pline->setendpoint(ptnewend); //this change doesn't get undone is there any other way to undo these field changes? here, i am using line as an example but i am wondering if this is true for all oddbentities? thx. this is result of dd undo recording defect. if object is still opened it has "newobject" flag set even after second startundorecord() call. as a result undo is not written. as a work around you can close the object - smart pointer to it should go out of scope (destroyed) or zeroed. code below works (red line inserted) code: pdb->startundorecord(); oddblineptr pnewline = oddbline::createobject(); pnewline->setstartpoint(odgepoint3d(0,0,0)); pnewline->setendpoint(odgepoint3d(10,10,0)); oddbblocktablerecordptr pspace = pdb->getactivelayoutbtrid().openobject(oddb::kforwrite); oddbobjectid id = pspace->appendoddbentity(pnewline); pnewline = 0; // heels the problem pdb->startundorecord(); oddblineptr pline = id.safeopenobject(oddb::kforwrite); pline->setstartpoint(odgepoint3d(5,5,0)); pline->setendpoint(odgepoint3d(5,20,0)); sergey slezkin |
所有的时间均为北京时间。 现在的时间是 02:55 PM. |