cad新学生 发表于 2007-5-25 14:23:00

求助!哪位高手帮我看看程序!关于填充的!

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

HuaiYu 发表于 2007-5-26 21:21:00

<p>你的大作中 pHatch-&gt;close();后再加一个 pDbBTR-&gt;close();</p><p>你的模型空间没有关闭吧<br/></p>
页: [1]
查看完整版本: 求助!哪位高手帮我看看程序!关于填充的!