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

设置夹点移动过程中,用于捕捉的参考点的坐标,参考点等于夹点位置加向vecExSnap[i]向量得到

C++
virtual Mcad::ErrorStatus getGripPointExSnap(int iIndex, McGeVector3ddArray& vecExSnap);
参数 
说明 
int iIndex 
夹点索引号 
McGeVector3ddArray& vecExSnap 
计算参考点的向量数组,可以有多个参考点,所以返回一个数组 

如果成功返回Mcad::eOk,如果传递的数据非法则返回Mcad::eInvalidInput

例如:sampleCustomEntityCustomEntity.sln例程

    Mcad::ErrorStatus CLinkBlock::getGripPointExSnap(int iIndex,
        McGeVector3ddArray& vecExSnap)
    {
        if(iIndex == 0)
        {
            McDbBlockReference tmpBlkRef;
            tmpBlkRef.setPosition(m_pos);
            tmpBlkRef.setScaleFactors(m_scale);
            tmpBlkRef.setRotation(m_dRotation);
            tmpBlkRef.setBlockTableRecord(m_idBlkRec);
            McGeMatrix3d mat = tmpBlkRef.blockTransform();

            for(int i =0; i < m_aryLinkPoint.length();i++)
            {
                AcGePoint3d tmp = m_aryLinkPoint[i];
                tmp.transformBy(mat);

                vecExSnap.append(tmp - m_pos);
            }
        }
        return Mcad::eOk;
    }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!