- (defun c:tt()
- (if (and
- (setq e (car(entsel "\n选择图块:")))
- (setq el (entget e))
- (= "INSERT" (cdr (assoc 0 el)))
- (setq newname (getstring "\n输入块名:"))
- (/= "" newname)
- )
- (progn
- (setq cp (cdr (assoc 10 el))
- xscl (cdr (assoc 41 el))
- yscl (cdr (assoc 42 el))
- zscl (cdr (assoc 43 el))
- rot (cdr (assoc 50 el))
- )
- (setq el (subst (cons 41 1.0) (assoc 41 el) el)
- el (subst (cons 42 1.0) (assoc 42 el)el)
- el (subst (cons 43 1.0) (assoc 43 el)el)
- el (subst (cons 50 0) (assoc 50 el)el)
- )
- (entmod el)
-
- (command "explode" e)
- (setq ss (ssget "p"))
- (command "block" newname "non"(trans cp 0 1) ss "")
- (command "insert" newname "non"(trans cp 0 1) xscl yscl (angtos rot))
- )
- )
- (princ)
-
- )
|