本帖最后由 作者 于 2003-12-19 9:50:30 编辑
我也写了一个,在轴上处理可能有些不对,参看一下。。。
- (defun c:Get( / ent ents start_ang end_ang s e n cr)
- (setq ent (car (entsel)))
- (setq ents (entget ent))
- (setq start_ang (cdr (assoc 50 ents)))
- (setq end_ang (cdr (assoc 51 ents)))
- (setq s (/ (* start_ang 4) 2 pi))
- (setq e (/ (* end_ang 4) 2 pi))
- (setq s (+ 1 (fix s)))
- (if (equal e 0 0.000000001) (setq e 4) (if (equal (fix e) e 0.00000001) (setq e (fix e)) (setq e (1+ (fix e)))))
- (if (> s e) (setq n (+ (- 4 s) e 1)) (setq n (+ 1(- e s))))
- (setq i 0 cr "圆弧通过")
- (repeat n
- (setq cr (strcat cr (itoa s) ","))
- (if (= s 4) (setq s 1) (setq s (1+ s)))
- )
- (setq cr (strcat cr "象限"))
- (princ cr)
- (princ)
- )
- )
|