黄玮 发表于 2006-3-10 16:51:00

关于extrude与extrudeAlongPath的问题(附程序)

<P>我想把一个圆沿一跟直线拉生成圆柱,用extrude可以实现,但是用extrudeAlongPath这个函数却出现问题?这是怎么回事?大家帮忙看看,先谢谢大家。</P>
<P>AcDbBlockTable *pThisBlockTable;<BR>&nbsp;acdbHostApplicationServices()-&gt;workingDatabase()-&gt;getSymbolTable(pThisBlockTable,<BR>&nbsp;&nbsp;AcDb::kForWrite);<BR>&nbsp;AcDbBlockTableRecord *pOtherBtr;<BR>&nbsp;pThisBlockTable-&gt;getAt(ACDB_MODEL_SPACE,pOtherBtr,AcDb::kForWrite);<BR>&nbsp;pThisBlockTable-&gt;close();</P>
<P>&nbsp;&nbsp;&nbsp; AcDbCircle *OCircle = new AcDbCircle(AcGePoint3d(0,0,0),AcGeVector3d(1,0,0),80);<BR>&nbsp;AcDbLine *line = new AcDbLine(AcGePoint3d(0,0,0),AcGePoint3d(100,0,0));<BR>&nbsp;AcDb3dSolid *OSolid = new AcDb3dSolid();<BR>&nbsp;AcDbObjectId OSolidId,liId;</P>
<P>&nbsp;pOtherBtr-&gt;appendAcDbEntity(liId,line);<BR>&nbsp;AcDbVoidPtrArray OArr,OgnArr;<BR>&nbsp;OArr.append(OCircle);<BR>&nbsp;OCircle-&gt;close();</P>
<P>&nbsp;int i;<BR>&nbsp;if (AcDbRegion::createFromCurves(OArr,OgnArr)!=Acad::eOk) &nbsp;<BR>&nbsp;{ <BR>&nbsp;&nbsp;for (i=0;i&lt;OgnArr.length();i++)&nbsp;<BR>&nbsp;&nbsp;&nbsp;delete OgnArr;<BR>&nbsp;&nbsp;return;<BR>&nbsp;}<BR>&nbsp;AcDbRegion *oRegion;<BR>&nbsp;oRegion=AcDbRegion::cast((AcRxObject*)OgnArr);</P>
<P>&nbsp;OSolid-&gt;extrudeAlongPath(oRegion,line);<BR>//&nbsp;OSolid-&gt;extrude(oRegion,100,0);<BR>&nbsp;&nbsp;&nbsp; pOtherBtr-&gt;appendAcDbEntity(OSolidId,OSolid);<BR>&nbsp;line-&gt;close();<BR>&nbsp;OSolid-&gt;close();<BR>&nbsp;pOtherBtr-&gt;close();</P>
页: [1]
查看完整版本: 关于extrude与extrudeAlongPath的问题(附程序)