- (defun HH:waist (en1 en2 / P0 P1E P1S P2E P2S P3)
- (setq p1s (vlax-curve-getStartPoint en1)
- p1e (vlax-curve-getendPoint en1)
- p2s (vlax-curve-getStartPoint en2)
- p2e (vlax-curve-getendPoint en2))
- (if(inters p1s p2s p1e p2e)
- (setq p0(mapcar '(lambda (X Y) (/ (+ X Y) 2.0)) p1s p2e)
- p3(mapcar '(lambda (X Y) (/ (+ X Y) 2.0)) p1e p2s))
- (setq p0(mapcar '(lambda (X Y) (/ (+ X Y) 2.0)) p1s p2s)
- p3(mapcar '(lambda (X Y) (/ (+ X Y) 2.0)) p1e p2e))
- )
- (entmake (list (cons 0 "LINE") (cons 10 P0) (cons 11 P3)))
- )
- (defun C:W2 (/ EN1 EN2)
- (setq en1 (car (entsel)))
- (setq en2 (car (entsel)))
- (HH:waist en1 en2)
- (princ)
- )
给你小改了下。。。我也不检查它们是否平行 |