[ARX]怎样消除样式替代???求救!!
在我的程序代码中我新建的tes.dwg文件中新建了一个标注样式"mydimsty",并把它置为当前标注样式,当程序运行完毕,我再去打开tes.dwg,打开其标注样式表查看的时候,发现当前标注样式不是mydimsty,而是它的一个样式替代,请问这是什么问题啊?怎么样解决这个问题!!请高手帮忙!!!!!我的程序请下载!!多谢了 我怎么上传不了我的程序啊???? void chushihua(AcDbDatabase *pdb)<BR>{<BR> //Ôö¼ÓÒ»¸ö×ÖÌåÑùʽ<BR> AcDbTextStyleTable *ptst;<BR> pdb->getTextStyleTable(ptst, AcDb::kForWrite);<BR> AcDbTextStyleTableRecord *ptstr=new AcDbTextStyleTableRecord;<BR> AcDbObjectId txtstyleid;<BR> ptst->getAt(ACDB_MODEL_SPACE,ptstr,AcDb::kForWrite);<BR> ptstr->setName("myhz");<BR> ptstr->setFileName("宋体");<BR> ptstr->setTextSize(3);<BR> ptstr->setXScale(0.7);<BR> ptst->add(txtstyleid,ptstr);<BR> pdb->setTextstyle(txtstyleid);<BR> ptst->close();<BR> ptstr->close();/////Ôö¼ÓÒ»¸ö±ê×¢Ñùʽ<BR> AcDbDimStyleTable *pdst;<BR> pdb->getDimStyleTable(pdst,AcDb::kForWrite);<BR> AcDbDimStyleTableRecord *pdstr=new AcDbDimStyleTableRecord;<BR> AcDbObjectId dimstyleid;<BR> pdst->getAt(ACDB_MODEL_SPACE,pdstr,AcDb::kForWrite);<BR> pdstr->setName("mydimsty");<BR> pdst->add(dimstyleid,pdstr);<BR> pdb->setDimstyle(dimstyleid);<BR> pdb->setDimstyleData(pdstr);<BR> pdstr->setDimadec(3);<BR> AcCmColor suiceng;<BR> suiceng.setColorIndex(256);<BR> pdstr->setDimclrd(suiceng);<BR> pdstr->setDimclre(suiceng);<BR> pdstr->setDimclrt(suiceng);<BR> pdstr->setDimtxsty(txtstyleid);<BR> pdstr->setDimtxt(3);<BR> pdstr->setDimexo(0);<BR> pdstr->setDimgap(0.625);<BR> pdstr->setDimtih(0);<BR> pdstr->setDimasz(3);<BR> pdstr->setDimtad(1);<BR> pdstr->close();<BR> pdst->close();<BR> <BR>}<BR>////////////////////////////////////////<BR>void shishi()<BR>{<BR> AcDbDatabase *pDb = new AcDbDatabase();<BR> <BR> AcDbBlockTable *pBtbl;<BR> pDb->getSymbolTable(pBtbl, AcDb::kForRead);<BR> chushihua(pDb);<BR> AcDbBlockTableRecord *pBtblRcd;<BR> pBtbl->getAt(ACDB_MODEL_SPACE, pBtblRcd,<BR> AcDb::kForWrite);<BR> pBtbl->close();<BR> pBtblRcd->close();<BR> pDb->saveAs("D:\\tes.dwg");<BR> delete pDb;<BR>} OK,已解决!此程序无错,只要改变几行代码的顺序位置就可以了!有问题可以加我QQ,共同学习!!
页:
[1]