yfy2003发表于2005-9-10 10:19:00
更新绘图区acedGetAcadDwgView()->UpdateWindow();
用了这行代码还是没有什么反应的
BeginEditorCommand();
//焦点给acad主窗体 AfxGetMainWnd()->SetFocus(); //将当前文档锁定,因为要写入实体了 acDocManager->lockDocument( acDocManager->curDocument(), AcAp::kWrite, NULL, NULL,true) ;
//添加直线到块表记录 AcDbBlockTable* pBlockTable=NULL; AcDbBlockTableRecord* pSpaceRecord=NULL; acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable, AcDb::kForRead); pBlockTable->getAt(ACDB_MODEL_SPACE, pSpaceRecord, AcDb::kForWrite); pBlockTable->close();
AcDbLine *pLine=new AcDbLine(stPntNew,edPntNew);
pSpaceRecord->appendAcDbEntity(LineId,pLine); pSpaceRecord->close();
//添加新层 AcDbLayerTable *pLayerTable; acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pLayerTable, AcDb::kForWrite); if(!pLayerTable->has("Line")) { AcDbLayerTableRecord *pLayerTableRecord=new AcDbLayerTableRecord; pLayerTableRecord->setName("Line"); pLayerTable->add(pLayerTableRecord); pLayerTableRecord->close(); } pLayerTable->close(); pLine->setLayer("Line"); pLine->setColorIndex(1);
pLine->close();
//更新绘图区域 acedGetAcadDwgView()->UpdateWindow(); //文档解锁 acDocManager->unlockDocument(acDocManager->curDocument());
//返回模式对话框 CompleteEditorCommand();
|