|
- UCS不与屏幕平行时可以这样
-
- BOOL ptInView(AcGePoint3d pt)
- {
- resbuf rb;
- acedGetVar(采用T("SCREENSIZE"),&rb);
- CRect CADrect;
- acedGetAcadDwgView()->GetClientRect(CADrect);
- int num=acedGetWinNum(CADrect.left,CADrect.top);
- AcGeMatrix mat;
- acedGetCurrentUCS(mat);
- mat.inverse();
- pt.transformBy(mat);
- CPoint cp;
- acedCoordFromWorldToPixel(num,asDblArray(pt),cp);
- return (cp.x<0 | cp.y<0 | cp.x>rb.resval.rpoint[0] | cp.y>rb.resval.rpoint[1]) ? FALSE : TRUE;
- }
复制代码 |
|