实现代码:
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();
}
加载生成的arx文件,输入命令AddDimStyle,输入想要创建的样式名,选择“格式|标注样式”可以看到如下结果:
————————————————
版权声明:本文为CSDN博主「楚兴」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/foreverling/article/details/28268811
原文:https://www.cnblogs.com/mjgw/p/12392649.html