试图更改CAD文件中数字标注内容时出错(附源码)
<p>试图更改CAD文件中数字标注内容时出错,源码如下:</p><p> //打开数据库</p><p>AcDbBlockTable *pBlockTable;<br/> acdbHostApplicationServices()->workingDatabase()->getBlockTable(pBlockTable,AcDb::kForWrite);<br/> AcDbBlockTableRecord *pBlockTableRecord;<br/> pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);<br/> pBlockTable->close();<br/> AfxMessageBox("open model space");</p><p> //创建块表记录遍历器,用遍历器遍历实体,并修改标注值。<br/> AcDbRotatedDimension *pDimention;<br/> char* Texttemp;<br/> ACHAR* Astr;<br/> Astr="111";<br/> AcDbBlockTableRecordIterator *pBlockIterator;<br/> pBlockTableRecord->newIterator(pBlockIterator);<br/> for(pBlockIterator->start();!pBlockIterator->done();pBlockIterator->step())<br/> {<br/> AcDbEntity *pEntity;<br/> pBlockIterator->getEntity(pEntity,AcDb::kForWrite);<br/> const char *pCname=pEntity->isA()->name();<br/> if(strcmp(pCname,"AcDbRotatedDimension")==0)<br/> {<br/> pDimention=AcDbRotatedDimension::cast(pEntity);<br/> Texttemp=pDimention->dimensionText();<br/> if(strcmp(Texttemp,"e")==0)<br/> {<br/> AfxMessageBox("found linedim");<br/> pDimention->setDimensionText(Astr);<br/> }<br/> }<br/> }<br/> delete pBlockIterator;<br/> pBlockTableRecord->close();</p><p>出错提示:内部错误:<a href="mailto:!scandr.cpp@803:eWasOpenForWrite">!scandr.cpp@803:eWasOpenForWrite</a></p><p>是不是CAD文件在打开时,不能用ARX修改实体。</p><p>期盼高手指点!!!<br/></p> 搞定了,实体没有关闭的缘故 thank you
页:
[1]