编译没有报错!但是执行时出错!哪位高手能指点一下,我的函数对不对?我一直在线!谢谢!毕业设计需要! AcDbObjectId AddHatch(const AcDbObjectIdArray idAr, const CString strPatName, const double dPatScale, const AcDbObjectId idLayer, AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase()) { AcDbBlockTable * pDbBT; AcDbBlockTableRecord * pDbBTR; AcDbObjectId idHatch; //»æÖÆͼ¿ì AcDbHatch* pHatch = new AcDbHatch; AcGeVector3d normal(0.0,0.0,1.0); pHatch->setNormal(normal); pHatch->setElevation(0.0); pHatch->setAssociative(Adesk::kFalse); if(strPatName=="") pHatch->setPattern(AcDbHatch::kPreDefined,"SOLID"); else pHatch->setPattern(AcDbHatch::kPreDefined,(LPCTSTR)strPatName); pHatch->appendLoop(AcDbHatch::kExternal, idAr); pHatch->setPatternScale(dPatScale); pHatch->setPatternSpace(dPatScale); pHatch->evaluateHatch(); pHatch->setLayer(idLayer); pDb->getSymbolTable(pDbBT, AcDb::kForRead); pDbBT->getAt(ACDB_MODEL_SPACE, pDbBTR, AcDb::kForWrite); pDbBTR->appendAcDbEntity(idHatch, pHatch); pHatch->close(); return idHatch; } |