我在用 new AcDbDatabase 创建的图形数据库中,用AcDbText创建文本标注,但设成水平中心对齐后显示位置不对,苦苦研究了两天,就是解决不了,同样的代码在打开的图形数据库则正常,请各位虾救救我吧! 以下两段代码都不行 代码1: AcDbText *pText=new AcDbText; pText->setHorizontalMode(AcDb::kTextCenter); pText->setAlignmentPoint(PointZDH); pText->setTextString(m_szDrawZDH); pText->setTextStyle(TextStyleZDH); pText->setHeight(2.5*m_DrawScale); pText->setRotation(0.0); AcDbObjectId textId; pBlockTableRecord->appendAcDbEntity(textId,pText); pText->adjustAlignment(m_pDb); pText->close(); 代码2: AcDbText *pText=new AcDbText(PointZDH,m_szDrawZDH,TextStyleZDH,2.5*m_DrawScale); AcDbObjectId textId; pBlockTableRecord->appendAcDbEntity(textId,pText); pText->setHorizontalMode(AcDb::kTextMid); pText->setAlignmentPoint(PointZDH); pText->setColorIndex(m_DrawColor); pText->setLayer(m_LayerZJ); pText->setWidthFactor(0.8); pText->adjustAlignment(m_pDb); pText->close(); |