ObjectARX_IntersectWith实体是否相交

IntersectWith:判断实体是否相交。数组

IntersectWith函数的定义形式(1)为:函数

void IntersectWith(Entity entityPointer,Intersect intersectType,Point3dCollection points,Int32 thisGraphicSystemMarker,Int32 otherGraphicSystemMarker);

第一个参数:entityPointer:实体;第二个参数:intersectType:相交的类型(AcDb::kOnBothOperands:俩个实体都不延伸; ExtendBoth : 两个实体都延伸 ; ExtendArgument :只延伸做为参数的实体(该方法的第一个参数; ExtendThis : 只延伸原实体(调用该方法的实体) )this

)第三个参数:获取全部相交的点。3d

IntersectWith函数的定义形式(2)为:code

void IntersectWith(Entity entityPointer, Intersect intersectType,Plane projectionPlane,Point3dCollection points, Int32 thisGraphicSystemMarker,Int32 otherGraphicSystemMarker);

与前一种定义形式相比,多了第三个参数: 当前两个实体相交的投影平面 。it

具体用法如例:io

AcGePoint3dArray polyLine;//点数组
AcDbPolyline * pPl = ArxUtils::CreatePolyline(polyLine,true);//多段线
if (NULL == pPl)
   return false;
Acad::ErrorStatus es;
AcDbEntity *pEntity = NULL;//多段线实体
es = acdbOpenObject(pEntity,arrPolyLineId[nIndex],AcDb::kForRead);
if (es != Acad::eOk)
    return false;
pPl->intersectWith(pEntity,AcDb::kOnBothOperands,intersectPoints);
if (intersectPoints.length() > 0)
   return true;//有交点
相关文章
相关标签/搜索