设置文字样式并写入CAD
来源:互联网 发布:unity3d中UI text是 编辑:程序博客网 时间:2024/05/01 20:54
//设置字体样式
AcDbObjectId CMainDlg::createTextStyle(CString fontName,CString bigFontName,CString textStyleName)
{
Acad::ErrorStatus es;
AcApDocument *pDoc=acDocManager->curDocument();
es=acDocManager->lockDocument(pDoc);
if(es!=Acad::eOk)
{
acutPrintf("锁定文档失败");
return NULL;
}
AcDbObjectId textStyleId;
AcDbTextStyleTable textStyleTable;
//textStyleTable.getAt("宋体",textStyleId,false);
AcGiTextStyle *TextStyle=new AcGiTextStyle(fontName,bigFontName,0,0,0,0,Adesk::kFalse,Adesk::kFalse,
Adesk::kFalse,Adesk::kFalse,Adesk::kFalse,textStyleName); //字体名
toAcDbTextStyle(*TextStyle,textStyleId);
acDocManager->unlockDocument(pDoc);
return textStyleId;
}
//文字写入
void CMainDlg::createText(AcGePoint3d pt,CString strText,double scale,double high/*,CString textCate*/)
{
Acad::ErrorStatus es;
AcApDocument *pDoc=acDocManager->curDocument();
es=acDocManager->lockDocument(pDoc);
if(es!=Acad::eOk)
{
acutPrintf("锁定文档失败");
return;
}
//在这里如果是hztxt.shx为什么还显示不正确只有hztxt.txt才没有问号?
AcDbObjectId textId= createTextStyle("新宋体","","vm");
AcDbText *ptext=NULL;
int nLength=strText.GetLength();
char *ch=new char(nLength);
ch=strText.GetBuffer(0);
ptext=new AcDbText(pt,ch,textId,high,0);
ptext->setWidthFactor(scale);
ptext->setColorIndex(0);
AcDbBlockTable *pblocKTable;
acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pblocKTable,AcDb::kForRead);
AcDbBlockTableRecord *pblocKTableRecord;
pblocKTable->getAt(ACDB_MODEL_SPACE,pblocKTableRecord,AcDb::kForWrite);
pblocKTableRecord->appendAcDbEntity(textId,ptext);
pblocKTable->close();
pblocKTableRecord->close();
ptext->close();
acDocManager->unlockDocument(pDoc);
}
- 设置文字样式并写入CAD
- Objectarx 设置CAD标注样式
- android 设置文字样式
- jQuery设置文字样式
- 学习笔记——cad.net 创建文字样式
- CAD二次开发(C#)之添加文字样式
- Highcharts 设置坐标轴文字样式
- android 为TextView的部分文字设置超链接样式并监听点击事件
- 为 TextView 的部分文字设置超链接样式并监听点击事件
- android 为TextView的部分文字设置超链接样式并监听点击事件
- Swift - 给图片添加文字水印(图片上写文字,并可设置位置和样式)
- 【译】样式研究:设置易读的文字
- Android TextView设置部分文字样式
- 使用SpannableString设置TextView文字样式
- CSS设置字体和文字样式
- android中设置textview文字样式
- 同一个textview设置不同文字样式
- <span>标签,为文字设置单独样式
- 一个封装的实用的EXCEL类
- 你可能是盗版软件的受害者
- sturts分页处理
- Linux推荐网站
- XML DOm方法备忘录
- 设置文字样式并写入CAD
- fso支持的打开及关闭命令
- JAVA编码--Gbk-->Utf8
- XML DOm属性备忘录
- 建立CADUIPALETTE
- 程序开发EQ浅淡
- ab的博客,关注中石化
- 一个SQL Server数据库备份与还原操作的类
- 点光源,法线贴图+点光源,视差贴图+法线贴图+点光源的效果比较