本帖最后由 ludaweb 于 2014-11-15 12:21 编辑
批量给圆开洞的源码。
- ;圆开洞
- (defun c:tt (/ ss i en ent ptc rad an)
- (if (and (princ "\n选择圆:") (setq ss (ssget '((0 . "CIRCLE")))))
- (progn
- (setq i 0)
- (repeat (sslength ss)
- (setq en (ssname ss i)
- ent (entget en)
- i (1+ i)
- ptc (cdr(assoc 10 ent))
- rad (cdr(assoc 40 ent))
- an (/ pi -4))
- (entmake
- (list
- '(0 . "ARC")
- (cons 10 (polar ptc an (* 0.3 rad)))
- (cons 40 rad)
- (cons 50 (- (* pi 0.75) (atan (/ (sqrt 9775) 15))))
- (cons 51 (+ (* pi 0.75) (atan (/ (sqrt 9775) 15))))
- (cons 62 8)
- )
- )
- )
- )
- )
- (princ)
- )
|