hunanoh 发表于 2006-3-19 16:05:00

[ARX]求助捕捉的问题

<P>小弟最近想编写程序完成以下功能:创建一个点,并设置好捕捉方式,为以后的选取做好准备,但就是行不通,望哪位大虾有空指点一下。</P>
<P>void ARXgetosnappoints()<BR>{<BR>&nbsp;AcDbPoint *p1 = new AcDbPoint(AcGePoint3d(0.0, 0.0, 0.0));</P>
<P>&nbsp;AcDbBlockTable *pBlockTable;<BR>&nbsp;acdbHostApplicationServices()-&gt;workingDatabase()<BR>&nbsp;&nbsp;-&gt;getSymbolTable(pBlockTable, AcDb::kForRead);<BR>&nbsp;AcDbBlockTableRecord *pBlockTableRecord;<BR>&nbsp;pBlockTable-&gt;getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite);<BR>&nbsp;pBlockTable-&gt;close();</P>
<P>&nbsp;pBlockTableRecord-&gt;appendAcDbEntity(p1);<BR>&nbsp;pBlockTableRecord-&gt;close();</P>
<P>&nbsp;int gsSelectionMark;<BR>&nbsp;AcGePoint3d pickPoint;<BR>&nbsp;AcGePoint3d lastPoint;<BR>&nbsp;AcGeMatrix3d viewXform;<BR>&nbsp;AcGePoint3dArray snapPoints;<BR>&nbsp;AcDbIntArray geomIds;<BR>&nbsp;&nbsp;<BR>&nbsp;p1-&gt;getOsnapPoints(<BR>&nbsp;&nbsp;AcDb::kOsModeNear,<BR>&nbsp;&nbsp;gsSelectionMark,<BR>&nbsp;&nbsp;pickPoint,<BR>&nbsp;&nbsp;lastPoint,<BR>&nbsp;&nbsp;viewXform,<BR>&nbsp;&nbsp;snapPoints,<BR>&nbsp;&nbsp;geomIds);</P>
<P>&nbsp;ads_point result;<BR>&nbsp;acedGetPoint(NULL, "请选择一个点:", result);</P>
<P>&nbsp;p1-&gt;close();<BR>}</P>
页: [1]
查看完整版本: [ARX]求助捕捉的问题