高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】layouts cloning
layouts cloning
layouts cloning
i need to clone layouts (paper spaces) with all related objects, layers, blocks etc. from one database to another database. what is the correct way to do it? i think that wblockcloneobjects() doesn't applicable for this job.
best regards,
ivan obraztsov
i think wblockcloneobjects() is the way to go - get the oddbblocktablerecord which belong to that layout and clone it. (probably you should add the layout id manually in the ids array passed to wblockcloneobjects() but i'm not sure; you should experiment with it).
hope this helps.
best regards
chudomir
i try to use wblockcloneobjects() for cloning layouts, but application hangs on:
code:
oddbdatabaseptr newdb = dwgservice.createdatabase(true, m_db->getmeasurement());
{
oddbobjectidarray objects;
oddbidmappingptr pmap = oddbidmapping::createobject();
objects.push_back(m_db->getpaperspaceid());
m_db->wblockcloneobjects(objects, newdb->getblocktableid(), *pmap, oddb::kdrcreplace); // application hangs on
}
may be isn't right way to clone layouts?
best regards,
ivan obraztsov
oddbdatabaseptr newdb = dwgservice.createdatabase(true, m_db->getmeasurement());
{
oddbobjectidarray objects;
oddbidmappingptr pmap = oddbidmapping::createobject();
// i think this is needed?
pmapping->setdestdb(newdb);
objects.push_back(m_db->getpaperspaceid());
m_db->wblockcloneobjects(objects, newdb->getblocktableid(), *pmap, oddb::kdrcreplace); // application hangs on
}
also try different value for oddb:uplicaterecordcloning?
best regards
chudomir
this is dd bug. we'll try to fix for 1.12 to be posted today or on monday.
sergey slezkin
thank you for replay, sergey.
so if understand correctly to clone layout i need: clone layout block, clone layout record from layout dictionary, link these objects. anything else?
will dictionary record be cloned automatically during cloning layout block?
may be there is the more easy way to do this job?
best regards,
ivan obraztsov
|