angel0917 发表于 2007-10-10 21:53:00

[求助]getOsnapPoin和explode函数怎么使用

各位大虾一定要帮忙啊,我的毕业设计中要用到这两个函数,急啊。<br/>1。PEnt-&gt;getOsnapPoin()函数怎么使用?怎么捕捉不到点阿?<br/>&nbsp; &nbsp;AcGePoint3dArray snapPoints;<br/>&nbsp; &nbsp;AcDbIntArray geomIds;<br/>&nbsp;&nbsp;AcGePoint3d pp;<br/>&nbsp;&nbsp;acedGetPoint(NULL,_T("选择附近点"),asDblArray(pp));<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Acad::ErrorStatus es = pEnt1-&gt;getOsnapPoints(AcDb::kOsModeCen, 0, pp, pp, AcGeMatrix3d::kIdentity, snapPoints, geomIds);<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;for(int i = 0;i&lt;snapPoints.length();i++)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;{<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;acutPrintf(_T("\nthe point is %f,%f,%f/n"),snapPoints.x ,snapPoints.y,snapPoints.z );<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;pEnt1-&gt;close();<br/>运行没有结果,不知何故。<br/>我就是想得到捕捉的点坐标:(<br/>2。我想将一个块炸开,然后将炸开得到的实体中的直线获得。下面作怎么不行啊?<br/>if(pEnt1-&gt;isKindOf(AcDbBlockReference::desc()))<br/>&nbsp;&nbsp;{&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if (pEnt1-&gt;upgradeOpen()!=Acad::eOk)<br/>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; return;<br/>&nbsp; &nbsp;AcDbVoidPtrArray entitySet1;<br/>&nbsp; &nbsp;Acad::ErrorStatus es;<br/>&nbsp; &nbsp;es=AcDbBlockReference::cast(pEnt1)-&gt;explode(entitySet1);<br/>&nbsp; &nbsp;int i=entitySet1.length();<br/>&nbsp; &nbsp;<br/>&nbsp; &nbsp;acutPrintf(_T("number%d"), i);<br/>}<br/>怎么块不能分解呢?而且实体个数 i 没有数值显示。<br/>先谢谢各位了!帮帮我把。
页: [1]
查看完整版本: [求助]getOsnapPoin和explode函数怎么使用