![]() |
【转帖】basic question about explodegeometrytoblock
basic question about explodegeometrytoblock
basic question about explodegeometrytoblock hello, i am certainly doing some very basic stuff wrong. i am trying to explode a oddbentity ("ent" in the following code) into a block. but all ids turn out to be zero. the entity originates from an iteration over the entities of a modelspace of a preiously opened database. i do have access to all properties of the entity, which in my case is a mtext entity. code: odsmartptr<oddbblocktablerecord> res = oddbblocktablerecord::createobject(); oddbobjectidarray ids; odresult ok = ent->explodegeometrytoblock(res, &ids); int l = ids.length(); for (int i=0; i<l; ++i) { if (!(ids[i].isnull())) { oddbobjectid id = ids[i]; oddbobjectptr entity = id.safeopenobject(); } }i broke the code down from a c# program where i am using a c# wrapper to dwgdirect, so i could test it with c++. so my code may look a bit awkward. thank you for any hint and especially a for a reference where i would have found the solution myself. gerhard you explode entities to a non-database resident block, therefore explode results are ndbro too, they have no ids. vladimir thank you vladimir! this was the information i was missing. where could i have found it? i had to safeopenobject the blocktableid of the database as oddb::kforwrite and then add my oddbblocktablerecord to that database. now it works. thanks gerhard quote: where could i have found it? i don't think it is explicitly stated anywhere. it is just logical - object id is a property of a database resident object, i.e. no database = no object id. vladimir |
所有的时间均为北京时间。 现在的时间是 11:01 AM. |