Try ...
- (defun Line2-1 (sset)
- (setq pts (acet-geom-ss-extents sset nil) ; ET needed
- xx1 (caar pts)
- xx2 (caadr pts)
- yy5 (/ (+ (cadar pts) (cadadr pts)) 2)
- pt1 (list xx1 yy5)
- pt2 (list xx2 yy5)
- )
- (command "erase" sset "")
- (entmake (list '(0 . "LINE") (cons 10 pt1) (cons 11 pt2)))
- )
- (defun AC2-1 (sset)
- (setq ee1 (ssname sset 0)
- ee2 (ssname sset 1)
- rr1 (cdr (assoc 40 (entget ee1)))
- dat (entget ee2)
- rrr (assoc 40 dat)
- rr2 (/ (+ rr1 (cdr rrr)) 2)
- )
- (entmod (subst (cons 40 rr2) rrr dat))
- (command "erase" ss "r"ee2 "")
- )
- (defun C:test ()
- (setq ss (ssget '((0 . "Arc,Circle,Line")))
- nn (sslength ss)
- )
-
- (cond
- ((> nn 2)
- (cond
- ((setq ssa (ssget "P" '((0 . "Arc"))))
- (AC2-1 ssa)
- )
- ((= nn 4) ; Lines
- (Line2-1 ss)
- )))
- (T ; Circle
- (AC2-1 ss)
- ))
- )
|