如果知道两点坐标
用ARX如何实现尺寸标注?可以的话给个程序段源码。
在线等,请高手们指点
另外,我下面的函数写出的字体的宽度系数和设置的宽度系数不一致,其他没问题
请帮忙看一下,哪里有问题,谢谢!
Acad::ErrorStatus es; AcDbTextStyleTable *pTsTable;
es = curDoc()->database()->getSymbolTable(pTsTable,AcDb::kForRead); if (es != Acad::eOk) { AfxMessageBox("Couldn't get the text style table."); }
CString theFont = "宋体";
if (!pTsTable->has((LPTSTR)(LPCSTR)theFont)) { AcDbTextStyleTableRecord *pStyle = new AcDbTextStyleTableRecord;
pStyle->setFont((LPTSTR)(LPCTSTR)theFont,Adesk::kFalse,Adesk::kFalse,0,34); pStyle->setFileName(theFont); pStyle->setBigFontFileName(theFont);
pStyle->setTextSize(8); pStyle->setXScale(0.3); pStyle->setObliquingAngle(0); pStyle->setName(theFont); pStyle->setIsShapeFile(Adesk::kFalse); pStyle->setIsVertical(Adesk::kFalse);
pTsTable->upgradeOpen(); es = pTsTable->add(pStyle); if (es != Acad::eOk) { CString message; message.Format("%d",es); AfxMessageBox(message); } pStyle->close(); }
AcDbObjectId styleId;
es = pTsTable->getAt(theFont,styleId); if (es != Acad::eOk) { CString message; message.Format("%d",es); AfxMessageBox(message); }
pTsTable->close();
AcDbText * text = new AcDbText(AcGePoint3d(10,10,0),"你好",styleId,8,0); AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable,AcDb::kForRead); AcDbBlockTableRecord *pBlockTableRecord; pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite); pBlockTable->close(); AcDbObjectId textId; es = pBlockTableRecord->appendAcDbEntity(textId,text); text->close(); pBlockTableRecord->close(); |