![]() |
【转帖】problem in naming a block record
problem in naming a block record
problem in naming a block record hi when i execute this code i get a null insted of the block record which i added. please note that the block record starts with a '*'. ================================================== ======== pdatabase = svcs.createdatabase(true, oddb::kmetric); char symbol_name[char_buffer_lenght]; odstring block_name(symbol_name); oddbblocktableptr pblocktable; oddbblocktablerecordptr pblock; // getting block table from a database pblocktable = pdatabase->getblocktableid().safeopenobject(oddb::kforwrite) ; // creating a new block pblock = oddbblocktablerecord::createobject(); pblock->setname(block_name = "*test"); // adding it to a block table pblocktable->add(pblock); pblock.release(); oddbobjectid objid = pblocktable->getat(block_name); ================================================== ======== the object objid.isnull() = true "*" is invalid symbol for "ordinary" block names. anonymous block names start with "*". anonymous block names do not need to be set unique. a numbers representing index of the block in block table is appended to the name. after you add "*test" block to the block table it actually gets name "*test<nnn>" names starting with "*" should not be used for non-anonymous blocks. sergey slezkin |
所有的时间均为北京时间。 现在的时间是 08:24 PM. |