史蒂夫
试试这个稍微编辑过的代码
- (defun c:TesT2 (/ blk ss l name)
- ; TharwaT 04. 04. 2011
- (if
- (and (setq blk (entsel "\n Select Block :"))
- (setq ss (ssget "_:L" '((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE"))))
- (setq l (getdist "\n Distance between Blocks :"))
- (setq scl (getdist "\n Enter a scale :"))
- )
- (progn
- (setq name (cdr (assoc 2 (entget (car blk)))))
- ((lambda (i / ss1)
- (while
- (setq ss1 (ssname ss (setq i (1+ i))))
- (setq marker(entlast))
- (command "_.measure" ss1 "Block" name "_Y" l)
- (while (setq en (entnext marker))
- (setq elist (entget en)
- pt (cdr (assoc 10 elist)))
- (command "_scale" en "" "_non" pt scl)
- (princ (cdr (assoc 2 elist)))
- (entupd en)
- (setq marker en)
- )
- )
- )
- -1
- )
- )
- (princ)
- )
- (princ)
- )
~'J'~ |