www.mxdraw.com
内容索引主面
前一个向上下一个
MrxDbgUtils::findEntAtPoint 方法

在一定的精度范围内查找一个点处的实体

C++
static bool findEntAtPoint(IN McGePoint3d pt, IN struct resbuf* pFilter, OUT McDbObjectIdArray& aryId, IN double dTol = -1.0, IN MxSSGetSubEntity* pSubEntitys = NULL);
参数 
说明 
IN McGePoint3d pt 
搜索点,WCS坐标系统 
IN struct resbuf* pFilter 
过滤条件 
OUT McDbObjectIdArray& aryId 
返回找到实体id数组 
IN double dTol = -1.0 
搜索范围 
IN MxSSGetSubEntity* pSubEntitys = NULL 
查到的块里面的实体 

找到实体后,返回true

例如:该函数源码为:

    bool MrxDbgUtils::findEntAtPoint(IN McGePoint3d pt,IN struct resbuf* pFilter,
    OUT McDbObjectIdArray& aryId,IN double dTol)
    {
        aryId.setLogicalLength(0);
        pt = MrxDbgUtils::wcsToUcs(pt);
        McGePoint3d pt1 = pt + dTol * (McGeVector3d::kXAxis + McGeVector3d::kYAxis);
        McGePoint3d pt2 = pt - dTol * (McGeVector3d::kXAxis + McGeVector3d::kYAxis);

        mds_name        ss;
        int result = Mx::mcedSSGet(_T("_C"), asDblArray(pt1), asDblArray(pt2), pFilter, ss);
        if(result != RTNORM)
        {
            return false;
        }

        long sslen;
        if (Mx::mcedSSLength(ss, &sslen) != RTNORM) 
        {
            Mx::mcedSSFree(ss);
            return false;
        }

        for(int i = 0; i < sslen;i++)
        {
            mds_name ent;
            Mx::mcedSSName(ss, i, ent);

            McDbObjectId id;
            Mx::mcdbGetObjectId(id,ent);
            aryId.append(id);
        }   
        Mx::mcedSSFree(ss);

        return !aryId.isEmpty();
    }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!