直线类型
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);