本帖最后由 xyp1964 于 2014-8-9 15:39 编辑
- ;; 同名图块在插入点缩放
- ;; kgbl块改比例
- (defun c:kgbl (/ ed bname ss1 n nth1 new41 s1 pt1)
- (cmdla0)
- (if (and (setq ed (car (entsel "\n选择改比例之图块: ")))
- (xyp-etype s1 "INSERT")
- )
- (progn
- (setq bname (xyp-dxf 2 ed)
- ss1 (ssget "X" (LIST (cons 2 bname) (CONS 0 "INSERT")))
- n -1
- NTH1 (sslength ss1)
- )
- (princ "\n待处理图块: ")
- (princ bname)
- (princ " ,共 ")
- (princ NTH1)
- (princ " 个。")
- (setq new41 (ureal 1 "" "缩放比例" (xyp-dxf 41 ed))
- new41 (/ new41 (xyp-dxf 41 ed) 1.0)
- )
- (repeat NTH1
- (setq s1 (ssname ss1 (setq n (+ 1 n)))
- pt1 (xyp-dxf 10 s1)
- )
- (command "scale" s1 "" "non" pt1 new41)
- )
- )
- )
- (cmdla0)
- )
|