2018年7月27日 星期五
(DEFUN C:ttp()
(setvar "BLIPMODE" 0)
(setq OSM (getvar "osmode"))
(setvar "osmode" 0)
(setq en (entget (car(entsel "Please choose circle 1:\n "))))
(setq cp1 (cdr (assoc 10 en)))
(setq r1 (cdr (assoc 40 en)))
(setq en (entget (car(entsel "Please choose circle 2:\n "))))
(setq cp2 (cdr (assoc 10 en)))
(setq r2 (cdr (assoc 40 en)))
(setq en (entget (car(entsel "Please choose circle 3:\n "))))
(setq cp3 (cdr (assoc 10 en)))
(setq r3 (cdr (assoc 40 en)))
(setq ang1 (angle cp3 cp1))
(setq ang2 (angle cp3 cp2))
(setq test 1)
(while (>= test 0.001)
(setq p1 (polar cp3 ang1 r3))
(setq d1 (- (distance p1 cp1) r1))
(setq d2 (+ (distance p1 cp2) r2))
(setq test (abs (- d1 d2)))
(setq ang1 (+ ang1 0.00001))
; (princ ang1)
)
(setq ang1 (angle p1 cp1))
(setq ang2 (angle p1 cp2))
(setq p2 (polar p1 ang1 d1))
(setq p3 (polar p1 ang2 d1))
(command "ARC" "C" p1 p2 p3)
(setvar "osmode" OSM)
)
(setvar "BLIPMODE" 0)
(setq OSM (getvar "osmode"))
(setvar "osmode" 0)
(setq en (entget (car(entsel "Please choose circle 1:\n "))))
(setq cp1 (cdr (assoc 10 en)))
(setq r1 (cdr (assoc 40 en)))
(setq en (entget (car(entsel "Please choose circle 2:\n "))))
(setq cp2 (cdr (assoc 10 en)))
(setq r2 (cdr (assoc 40 en)))
(setq en (entget (car(entsel "Please choose circle 3:\n "))))
(setq cp3 (cdr (assoc 10 en)))
(setq r3 (cdr (assoc 40 en)))
(setq ang1 (angle cp3 cp1))
(setq ang2 (angle cp3 cp2))
(setq test 1)
(while (>= test 0.001)
(setq p1 (polar cp3 ang1 r3))
(setq d1 (- (distance p1 cp1) r1))
(setq d2 (+ (distance p1 cp2) r2))
(setq test (abs (- d1 d2)))
(setq ang1 (+ ang1 0.00001))
; (princ ang1)
)
(setq ang1 (angle p1 cp1))
(setq ang2 (angle p1 cp2))
(setq p2 (polar p1 ang1 d1))
(setq p3 (polar p1 ang2 d1))
(command "ARC" "C" p1 p2 p3)
(setvar "osmode" OSM)
)
訂閱:
文章 (Atom)