本帖最后由 llsheng_73 于 2015-4-17 12:09 编辑
- (defun Pldir(pts)
- (<(apply'+(mapcar'(lambda(x y)(-(*(car x)(cadr y))(*(car y)(cadr x))))pts(append(cdr pts)(list(car pts)))))0))
- (defun plinexy(e / p i)
- (setq i -1)
- (mapcar(function(lambda(x)(list(car x)(cadr x))))(reverse(repeat(fix(1+(vlax-curve-getEndParam e)))
- (setq i(1+ i)p(cons(vlax-curve-getPointAtParam e i)p)))))
- (if(equal(car p)(last p))(reverse(cdr(reverse p)))p)
- )
(setq e(car(entsel"选择闭合多线段")))
(alert(if (Pldir(plinexy e))"逆时针""顺时针")
|