![]() |
【转帖】copy entity to another drawing
copy entity to another drawing
copy entity to another drawing i want to copy a number of entities from one drawing into another. i tried deepcloneobjects() and wblockcloneobjects() but both crash sometimes on my input. if circles are in the list it seems to fail always, and some lwpolylines make the function to malfunction? is this the right solution, or is there another way? code snippet: // iterate drawing to fill objlist (objlist.append(objectid) if (!objlist.empty()) { oddbidmappingptr pmapping = oddbidmapping::createobject(); pmapping->setdestdb(m_outputfile.getdatabaseptr()); oddbdatabaseptr& pdb = m_outputfile.getdatabaseptr(); pdb->wblockcloneobjects( objlist, pdb->getmodelspaceid(), *pmapping, oddb::kdrcignore ); } } the problem was that i used destination database as the source database. the entities to copy were of course not there and the program crashed. thanks everybody who helped me on this problem. erik does it works with tableentries too ? hi, can i use wblockcloneobjects to clone tablerecords ? and, if i clone a blockreference, does the function copy the blocktablerecord and all objects from the blockdefinition and all needed layers, dimstyles ... ? quote: originally posted by uwe spiess hi, can i use wblockcloneobjects to clone tablerecords ? and, if i clone a blockreference, does the function copy the blocktablerecord and all objects from the blockdefinition and all needed layers, dimstyles ... ? wblockcloneobjects clones everything, including layers, referenced blocks etc. erik hi erik, thanks for reply, unfortunatly such clear hints are not in the reference. best regards, uwe hi erik, iam confused about you mentioning destination database as source database. "the problem was that i used destination database as the source database. " can you please tell me in detail.i didnt get any crash as such but was unable to write block information to the destination database with the logic that you were mentioning. thanks in adv, aparna |
所有的时间均为北京时间。 现在的时间是 04:38 AM. |