![]() |
【转帖】create objects another one
create objects another one.
create objects another one. i have two version code to append a line: version 1: oddbline2dptr pline = oddbline::createobject(); pline->setstartpoint(odgepoint3d(0.,0.,0.)); pline->setendpoint(odgepoint3d(1.,1.,1.)); oddbblocktablerecordptr pstable = getmodelspaceid().safeopenobject(oddb::kforwrite); pstable->appendoddbentity(pent); ---------------------------------------------------------------- version 2: oddbline2dptr pline = oddbline::createobject(); oddbblocktablerecordptr pstable = getmodelspaceid().safeopenobject(oddb::kforwrite); id = pstable->appendoddbentity(pent); pline = id.safeopenobject(oddb::kforwrite); pline->setstartpoint(odgepoint3d(0.,0.,0.)); pline->setendpoint(odgepoint3d(0.,0.,0.)); what is the better version? why? does the order change the results? its the same code with exception to pline = id.safeopenobject(oddb::kforwrite); if i'm not mistaken, i believe that this line is not needed because ::createobject opens the object for write. |
所有的时间均为北京时间。 现在的时间是 09:16 AM. |