高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】how to save the block with the name x1
how to save the block with the name "*x1".
how to save the block with the name "*x1".
i read the file "block.dwg",and i can find a block with the name "*x1".
i want to known how to save a block with the name "*x1".
following is my code.
oddbobjectid dbfiller::addblock(oddbdatabase* pdb,
const odstring& name)
{
oddbobjectid id;
oddbblocktableptr ptable = pdb->getblocktableid().safeopenobject(oddb::kforwrite) ;
oddbblocktablerecordptr precord = oddbblocktablerecord::createobject();
/************************************************** ********************/
/* block must have a name before adding it to the table. */
/************************************************** ********************/
precord->setname(name);
/************************************************** ********************/
/* add the record to the table. */
/************************************************** ********************/
id = ptable->add(precord);
return id;
}
attached files
blocks having name *<char><number> like *x1, *d234,
*u10 are a special kind of blocks. these blocks (called anonymous) are used for representing a contents of dimension entity, to save hatch entity to minor file versions etc.
setting their names you need not provide the number after character. use *x instead of *x1.
the number is simply index of block in block table which is substituted automatically to avoid name conflicts.
sergey slezkin
blocks with names starting with * are anonymous. such block name consists of the "*" symbol, one capital letter (a hint of the block purpose), and an index.
index is not controlled by user - it is assigned automatically, and may change after next loading. (actually it is really an index - in the block table)
when you create a new anonymous block, you set just "*x" as a name.
vladimir
thanks a lot .now i understand.
|