- 积分
- 1148
- 明经币
- 个
- 注册时间
- 2004-5-18
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2005-4-26 09:15:00
|
显示全部楼层
void chushihua(AcDbDatabase *pdb) { //Ôö¼ÓÒ»¸ö×ÖÌåÑùʽ AcDbTextStyleTable *ptst; pdb->getTextStyleTable(ptst, AcDb::kForWrite); AcDbTextStyleTableRecord *ptstr=new AcDbTextStyleTableRecord; AcDbObjectId txtstyleid; ptst->getAt(ACDB_MODEL_SPACE,ptstr,AcDb::kForWrite); ptstr->setName("myhz"); ptstr->setFileName("宋体"); ptstr->setTextSize(3); ptstr->setXScale(0.7); ptst->add(txtstyleid,ptstr); pdb->setTextstyle(txtstyleid); ptst->close(); ptstr->close();
/////Ôö¼ÓÒ»¸ö±ê×¢Ñùʽ AcDbDimStyleTable *pdst; pdb->getDimStyleTable(pdst,AcDb::kForWrite); AcDbDimStyleTableRecord *pdstr=new AcDbDimStyleTableRecord; AcDbObjectId dimstyleid; pdst->getAt(ACDB_MODEL_SPACE,pdstr,AcDb::kForWrite); pdstr->setName("mydimsty"); pdst->add(dimstyleid,pdstr); pdb->setDimstyle(dimstyleid); pdb->setDimstyleData(pdstr); pdstr->setDimadec(3); AcCmColor suiceng; suiceng.setColorIndex(256); pdstr->setDimclrd(suiceng); pdstr->setDimclre(suiceng); pdstr->setDimclrt(suiceng); pdstr->setDimtxsty(txtstyleid); pdstr->setDimtxt(3); pdstr->setDimexo(0); pdstr->setDimgap(0.625); pdstr->setDimtih(0); pdstr->setDimasz(3); pdstr->setDimtad(1); pdstr->close(); pdst->close(); } //////////////////////////////////////// void shishi() { AcDbDatabase *pDb = new AcDbDatabase(); AcDbBlockTable *pBtbl; pDb->getSymbolTable(pBtbl, AcDb::kForRead); chushihua(pDb); AcDbBlockTableRecord *pBtblRcd; pBtbl->getAt(ACDB_MODEL_SPACE, pBtblRcd, AcDb::kForWrite); pBtbl->close(); pBtblRcd->close(); pDb->saveAs("D:\\tes.dwg"); delete pDb; } |
|