www.mxdraw.com
内容索引主面
前一个向上下一个
McDbText 类

单行文字类型

C++
class McDbText : public McDbEntity;

dbents.h

例如:中中对齐绘制文字例程

    AcDbObjectId
    CDrawTable::AddToModelSpace(AcDbEntity* pEntity,AcDbDatabase* pDatabase)
    {
        AcDbObjectId objId;  
        AcDbBlockTableRecordPointer spBlkRec(ACDB_MODEL_SPACE,pDatabase,AcDb::kForWrite);
        if(spBlkRec.openStatus() != Acad::eOk)
            return AcDbObjectId::kNull;
        spBlkRec->appendAcDbEntity(objId, pEntity);
        pEntity->close();
        return objId;
    }
    AcDbObjectId CDrawTable::DrawMCText(AcGePoint3d pt,const CString& sTxt,double dTextHeight,AcDbDatabase* pDatabase)
    {
        AcDbText *pText = NULL;
        pText = new AcDbText;

        pText->setHorizontalMode(AcDb::kTextCenter);
        pText->setVerticalMode(AcDb::kTextVertMid);
        pText->setPosition(pt);
        pText->setAlignmentPoint(pt);
        pText->setTextString(sTxt);
        pText->setHeight(dTextHeight );
        pText->setColorIndex(MrxDbgUtils::kGreen);
        return AddToModelSpace(pText,pDatabase);
    }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!