问题已解决!使用acedGrRead()就可以循环跟踪鼠标动作啦 实现代码片断如下: AcDbBlockReference *pBlkRef = new AcDbBlockReference() ; pBlkRef->setBlockTableRecord(idNewBlock) ; AcGePoint3d pntRefPos(0.0,0.0,0.0) ; AcDbBlockTable *pCurBlkTab ; AcDbBlockTableRecord *pCurBlkTabRcd ; pCurDatabase->getBlockTable(pCurBlkTab,AcDb::kForRead) ; pCurBlkTab->getAt(ACDB_MODEL_SPACE,pCurBlkTabRcd,AcDb::kForWrite) ; pCurBlkTab->close() ; AcDbObjectId idBlkRef ; pCurBlkTabRcd->appendAcDbEntity(idBlkRef,pBlkRef) ; pBlkRef->close() ; resbuf res ; int type ; do { acedGrRead(1,&type,&res) ; pntRefPos[0] = res.resval.rpoint[0] ; pntRefPos[1] = res.resval.rpoint[1] ; acdbOpenObject(pBlkRef,idBlkRef,AcDb::kForWrite) ; pBlkRef->setPosition(pntRefPos) ; pBlkRef->close() ; } while (type != 3) ; |