- (defun C:SF(/ bp entl makeunblock ty xscal yscal)
- (defun MAKEUNBLOCK (ty ip / tmp errexit mbx BLAYER)
- (setvar "CMDECHO" 0)
- (if (and ip ty)
- (progn
- (entmake (list
- (cons '0 "BLOCK")
- (cons '2 "*U")
- (cons '70 1)
- (cons '10 ip)
- )
- )
- (entmake (setq el (entget ty)))
- (if (> (cdr (assoc 66 el)) 0)
- (while
- (/= "SEQEND"
- (cdr
- (assoc 0
- (entmake (setq el (entget (entnext (cdr (assoc -1 el))))))
- )
- )
- )
- )
- )
- (entdel ty)
- (setq tmp (entmake (list (cons '0 "ENDBLK"))))
- (entmake (list
- (cons '0 "INSERT")
- (cons '2 tmp)
- (cons '10 ip)
- ))
- )
- )
- )
- (if (setq ty (car(entsel "\n选择缩放图元:")))
- (progn
- (setvar "cmdecho" 0)
- (setq bp (getpoint "缩放基准点 (<0,0,0>): "))
- (if (not bp) (setq bp (list 0 0 0)))
- (setq xscal (getreal "X向比例因子 <1>: "))
- (if (not xscal) (setq xscal 1))
- (setq yscal (getreal "Y向比例因子 <1>: "))
- (if (not yscal) (setq yscal 1))
- (MAKEUNBLOCK ty bp)
- (setq
- entL (entget (entLast))
- entL (subst (cons 41 xscal) (assoc 41 entL) entL)
- entL (subst (cons 42 yscal) (assoc 42 entL) entL)
- )
- (entmod entL)
- (command "_explode" "l" "")
- )
- )
- (princ)
- )
|