高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】试图更改cad文件中数字标注内容时出错(附源码)
试图更改cad文件中数字标注内容时出错(附源码)
试图更改cad文件中数字标注内容时出错(附源码)
试图更改cad文件中数字标注内容时出错,源码如下:
//打开数据库
acdbblocktable *pblocktable;
acdbhostapplicationservices()->workingdatabase()->getblocktable(pblocktable,acdb::kforwrite);
acdbblocktablerecord *pblocktablerecord;
pblocktable->getat(acdb_model_space,pblocktablerecord,acdb::kforwrite);
pblocktable->close();
afxmessagebox("open model space");
//创建块表记录遍历器,用遍历器遍历实体,并修改标注值。
acdbrotateddimension *pdimention;
char* texttemp;
achar* astr;
astr="111";
acdbblocktablerecorditerator *pblockiterator;
pblocktablerecord->newiterator(pblockiterator);
for(pblockiterator->start();!pblockiterator->done();pblockiterator->step())
{
acdbentity *pentity;
pblockiterator->getentity(pentity,acdb::kforwrite);
const char *pcname=pentity->isa()->name();
if(strcmp(pcname,"acdbrotateddimension")==0)
{
pdimention=acdbrotateddimension::cast(pentity);
texttemp=pdimention->dimensiontext();
if(strcmp(texttemp,"e")==0)
{
afxmessagebox("found linedim");
pdimention->setdimensiontext(astr);
}
}
}
delete pblockiterator;
pblocktablerecord->close();
是不是cad文件在打开时,不能用arx修改实体。
期盼高手指点!!!
搞定了,实体没有关闭的缘故
|