|
[code]static void qxzyAddDimStyle_AddDimStyle(void)
{
ACHAR styleName[50];
if(acedGetString(Adesk::kFalse, _T("请输入样式名称:"), styleName) != RTNORM)
{
return;
}
AcDbDimStyleTable *pDimStyleTbl;
acdbHostApplicationServices()->workingDatabase()
->getDimStyleTable(pDimStyleTbl, AcDb::kForWrite);
if(pDimStyleTbl->has(styleName))
{
pDimStyleTbl->close();
return;
}
AcDbDimStyleTableRecord *pDimStyleTblRcd;
pDimStyleTblRcd = new AcDbDimStyleTableRecord();
pDimStyleTblRcd->setName(styleName);//样式名称
pDimStyleTblRcd->setDimasz(3);//箭头长度
pDimStyleTblRcd->setDimexe(3);//尺寸界线与标注
pDimStyleTblRcd->setDimtad(1);//文字位于标注线的上方
pDimStyleTblRcd->setDimtxt(3);//标注文字的高度
pDimStyleTbl->add(pDimStyleTblRcd);
pDimStyleTblRcd->close();
pDimStyleTbl->close();
}
[/code] |
|