[求助]如何用键盘输入做线段?
AcGePoint3d ptStart(0, 0, 0); //如何将两指定点改为键盘输入数据。即输入两点坐标,程序自动做线段。AcGePoint3d ptEnd(1000, 1000, 0);
AcDbLine *pLine = new AcDbLine(ptStart, ptEnd);
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase()
->getBlockTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
AcDb::kForWrite);
AcDbObjectId lineId;
pBlockTableRecord->appendAcDbEntity(lineId, pLine);
pBlockTable->close();
pBlockTableRecord->close();
pLine->close(); acedGetPoint? 一个循环,使用acedGetPoint()函数获取分别两个点,存储起来,然后使用存储的点来创建实体就可以了。
页:
[1]