- (defun c:tt()
- (defun dxf (code elist) (cdr (assoc code elist)))
- (vl-load-com)
- (while(not(setq pt1(entsel "\n\t选择第1条线: "))))
- (while(not(setq pt2(entsel "\n\t选择第2条线: "))))
- (setq l1 (entget(car pt1)))
- (setq l2 (entget(car pt2)))
- (setq p1 (dxf 10 l1) p2 (dxf 11 l1) p3 (dxf 10 l2) p4 (dxf 11 l2))
- (setq ang1 (angle p1 p2) ang2 (angle p3 p4))
- (setq dang (- ang1 ang2))
- (print dang)
- (if (or(equal (abs dang) 0 1e-3)(equal (abs dang) pi 1e-3)) (progn
- (setq a1 (vlax-curve-getclosestpointto (car pt1) '(0 0 0) t))
- (setq a2 (vlax-curve-getclosestpointto (car pt2) '(0 0 0) t))
- (setq a3 (abs (- (apply 'max a1) (apply 'max a2))))
- (print a3)
- (while(not(setq a4(getdist "\n\t请输入层板厚度 :"))))
- (while(not(setq a5(getdist "\n\t请输入层板数量 :"))))
- (setq a6 (/ (- a3 (* a4 a5) (+ a5 1))))
- (setq a7 1)
- (if (<= a7 a5) (princ))
- )
- (alert "\n两条线不平行不符合条件!")
- )
- (princ)
- )
剩下画线功能楼主自编吧 |