对于MLINE???,区域和三维实体我帮不上忙,但我想对于所有其他类型,这个修复可以做到。。。
- (defun c:customtransform ( / ss i entitylist obj new j x y )
- (if (setq ss (ssget "_:L"))
- (repeat (setq i (sslength ss))
- (setq entitylist (entget (ssname ss (setq i (1- i)))))
- (setq obj (ssname ss i))
- (setq new nil)
- (repeat (setq j (length entitylist))
- (cond
- ( (= 10 (car (nth (setq j (1- j)) entitylist)))
- (setq x (cadr (nth j entitylist))
- y (caddr (nth j entitylist))
- )
- (setq y (+ (+ (+ 0 332134.109) (* 0.40008331 x)) (* 0.59595102 y)))
- (setq x (+ (+ (+ 0 1087.012) (* 0.59595102 x)) (* -0.40008331 y)))
- (setq new (cons (list 10 x y) new))
- )
- ( (= 11 (car (nth j entitylist)))
- (setq x (cadr (nth j entitylist))
- y (caddr (nth j entitylist))
- )
- (setq y (+ (+ (+ 0 332134.109) (* 0.40008331 x)) (* 0.59595102 y)))
- (setq x (+ (+ (+ 0 1087.012) (* 0.59595102 x)) (* -0.40008331 y)))
- (setq new (cons (list 11 x y) new))
- )
- ( (= 12 (car (nth j entitylist)))
- (setq x (cadr (nth j entitylist))
- y (caddr (nth j entitylist))
- )
- (setq y (+ (+ (+ 0 332134.109) (* 0.40008331 x)) (* 0.59595102 y)))
- (setq x (+ (+ (+ 0 1087.012) (* 0.59595102 x)) (* -0.40008331 y)))
- (setq new (cons (list 12 x y) new))
- )
- ( (= 13 (car (nth j entitylist)))
- (setq x (cadr (nth j entitylist))
- y (caddr (nth j entitylist))
- )
- (setq y (+ (+ (+ 0 332134.109) (* 0.40008331 x)) (* 0.59595102 y)))
- (setq x (+ (+ (+ 0 1087.012) (* 0.59595102 x)) (* -0.40008331 y)))
- (setq new (cons (list 13 x y) new))
- )
- ( (= 14 (car (nth j entitylist)))
- (setq x (cadr (nth j entitylist))
- y (caddr (nth j entitylist))
- )
- (setq y (+ (+ (+ 0 332134.109) (* 0.40008331 x)) (* 0.59595102 y)))
- (setq x (+ (+ (+ 0 1087.012) (* 0.59595102 x)) (* -0.40008331 y)))
- (setq new (cons (list 14 x y) new))
- )
- ( (= 15 (car (nth j entitylist)))
- (setq x (cadr (nth j entitylist))
- y (caddr (nth j entitylist))
- )
- (setq y (+ (+ (+ 0 332134.109) (* 0.40008331 x)) (* 0.59595102 y)))
- (setq x (+ (+ (+ 0 1087.012) (* 0.59595102 x)) (* -0.40008331 y)))
- (setq new (cons (list 15 x y) new))
- )
- ( (= 16 (car (nth j entitylist)))
- (setq x (cadr (nth j entitylist))
- y (caddr (nth j entitylist))
- )
- (setq y (+ (+ (+ 0 332134.109) (* 0.40008331 x)) (* 0.59595102 y)))
- (setq x (+ (+ (+ 0 1087.012) (* 0.59595102 x)) (* -0.40008331 y)))
- (setq new (cons (list 16 x y) new))
- )
- ( t
- (setq new (cons (nth j entitylist) new))
- )
- )
- )
- (entdel obj)
- (entmake new)
- )
- )
- (princ)
- )
HTH,M.R。 |