;;;*********************************** ;;; No.22 线型比例缩放 函数 ;;; -By Ayunger Studio 2009.04.27 ;;;*********************************** (defun C:ayLTScale (/ SS1 entName1 entData1 xType dScale newLTScale i) (setq dScale 0.5) (while (not (setq SS1 (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))))) (prompt "\n【提示】放缩系数增大(F)/减小(S)...\n") (while (progn (princ (strcat "\r线型比例 鼠标右键放大/左键缩小 或 退出[空格], 当前系数=" (rtos dScale 2 3) " ")) (setq xType (grread)) (not (or (equal xType '(2 13)) (equal xType '(2 32))))) (setq i 0) (if (or (= (car xType) 12) (= (car xType) 3)); 3=鼠标左键缩小, 12=鼠标右键放大. (while (< i (sslength SS1)) (setq entName1 (ssname SS1 i)) (setq entData1 (entget entName1)) (if (assoc 48 entData1) (setq newLTScale (cdr (assoc 48 entData1))) (setq newLTScale 1.0) );end_if (if (= (car xType) 12);12=鼠标右键放大. (setq newLTScale (+ newLTScale dScale));then (if (> newLTScale dScale) (setq newLTScale (- newLTScale dScale))) );end_if (ayEntMod1 entName1 48 newLTScale) (setq i (+ i 1)) );end_while i );end_if (if (or (equal xType '(2 70)) (equal xType '(2 102)) (equal xType '(2 83)) (equal xType '(2 115)));放缩系数增大(F)/减小(S). (if (or (equal xType '(2 70)) (equal xType '(2 102)));F=系数增大. (setq dScale (* dScale 2.0));then (setq dScale (* dScale 0.5));else );end_if );end_if );end_while (princ) );end_defun
|