|
static void test(void)
{
ads_name ent;
AcGePoint3d pickPt(0, 0, 0);
if(acedEntSel(_T("/n请选择圆、圆弧或椭圆对象:"), ent,
asDblArray(pickPt)) != RTNORM)
{
return;
}
AcDbObjectId entId;
acdbGetObjectId(entId, ent);
AcDbEntity *pEnt;
acdbOpenAcDbEntity(pEnt, entId, AcDb::kForWrite);
pEnt->close();
AcGePoint3dArray snapPts;
AcDbIntArray geomIds;
pEnt->getOsnapPoints(AcDb::kOsModeCen, 0, pickPt, pickPt,
AcGeMatrix3d::kIdentity, snapPts, geomIds);
for(int i = 0; i < snapPts.length(); i++)
{
acutPrintf(_T("/n您点取的点是: %.4f, %.4f, %.4f"), pickPt.x,
pickPt.y, pickPt.z );
acutPrintf(_T("/n您捕捉到的点是: %.4f, %.4f, %.4f"), snapPts[0].x,
snapPts[0].y, snapPts[0].z );
}
} |
|