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

直线类型

C++
class McDbLine : public McDbCurve;

dbents.h

例如:绘制一条直线的代码如下:

    AcDbObjectId
    CTestCommands::AddToModelSpace(AcDbEntity* pEntity,AcDbDatabase* pDatabase,bool isAutoClose)
    {
        AcDbObjectId objId;  
        AcDbBlockTableRecordPointer spBlkRec(ACDB_MODEL_SPACE,pDatabase,AcDb::kForWrite);
        if(spBlkRec.openStatus() != Acad::eOk)
            return AcDbObjectId::kNull;
        spBlkRec->appendAcDbEntity(objId, pEntity);

        if(isAutoClose)
            pEntity->close();
        return objId;
    }

    // pt1,pt2是直线的开始两个点
    AcDbLine* pLine = new AcDbLine(pt1,pt2);
    return AddToModelSpace(pLine,pDatabase,true);
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!