![]() |
【转帖】试图更改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修改实体。 期盼高手指点!!! 搞定了,实体没有关闭的缘故 |
所有的时间均为北京时间。 现在的时间是 04:03 PM. |