求助!哪位高手帮我看看程序!关于填充的!
<p>编译没有报错!但是执行时出错!哪位高手能指点一下,我的函数对不对?我一直在线!谢谢!毕业设计需要!</p><p>AcDbObjectId AddHatch(const AcDbObjectIdArray idAr,<br/> const CString strPatName,<br/> const double dPatScale,<br/> const AcDbObjectId idLayer,<br/> AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase())<br/>{<br/> AcDbBlockTable * pDbBT;<br/> AcDbBlockTableRecord * pDbBTR;<br/> AcDbObjectId idHatch;</p><p> <br/>//»æÖÆͼ¿ì <br/>AcDbHatch* pHatch = new AcDbHatch;<br/>AcGeVector3d normal(0.0,0.0,1.0);<br/>pHatch->setNormal(normal);<br/>pHatch->setElevation(0.0);<br/>pHatch->setAssociative(Adesk::kFalse);<br/>if(strPatName=="")<br/> pHatch->setPattern(AcDbHatch::kPreDefined,"SOLID"); <br/>else<br/> pHatch->setPattern(AcDbHatch::kPreDefined,(LPCTSTR)strPatName); <br/> pHatch->appendLoop(AcDbHatch::kExternal, idAr);<br/>pHatch->setPatternScale(dPatScale);<br/>pHatch->setPatternSpace(dPatScale);</p><p>pHatch->evaluateHatch(); </p><p>pHatch->setLayer(idLayer);<br/>pDb->getSymbolTable(pDbBT, AcDb::kForRead);</p><p>pDbBT->getAt(ACDB_MODEL_SPACE, pDbBTR, AcDb::kForWrite);</p><p>pDbBTR->appendAcDbEntity(idHatch, pHatch);</p><p>pHatch->close();<br/>return idHatch;<br/>}</p> <p>你的大作中 pHatch->close();后再加一个 pDbBTR->close();</p><p>你的模型空间没有关闭吧<br/></p>
页:
[1]