![]() |
【转帖】deleted layout problem
deleted layout problem
deleted layout problem hi. i have problems when trying to delete and add layouts. after dwg file is opened i delete layouts (and blocks associated with layout) generated with our application and then i try to add new layouts: oddbobjectid layoutblockid; layoutid = db->createlayout(layoutname, &layoutblockid); oddblayoutptr layout = layoutid.openobject(oddb::kforwrite); assert(!layout->iserased()); db->setcurrentlayout(layoutid); createlayout method returns without error, i get new layout, iserased method returns false. but when call to setcurrentlayout fails with error 'object was deleted'. what can be wrong here? regards, dainius bekeris can you try the version of setcurrentlayout() which takes a string? also is m_caddb the same as *db? oddbobjectid layoutblockid; layoutid = db->createlayout(layoutname, &layoutblockid); db->setcurrentlayout(layoutname); best regards chudomir database is the same, it's my typing error. setcurrentlayout() with string behaves in the same way. maybe i shall put question other way. what is correct way to delete and create some layouts? now i am deleting layout and additionally block associated with layout (usually it is '*paper_space'). maybe 'object was deleted' is about deleted block? hi dainius, you should use the oddbdatabase::deletelayout() function - it erases both the associated layout and the assocated block table record. also be careful not to delete the model space or the last paperspace layout... hope this helps best regards chudomir sorry if not clear - i meant that you should not erase the block by yourself. best regards chudomir thanks, now it works. regards, dainius |
所有的时间均为北京时间。 现在的时间是 09:09 PM. |