🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
来自 [链接](http://bbs.mjtd.com/forum.php?mod=viewthread&tid=108656&extra=page%3D3%26filter%3Dtypeid%26typeid%3D107&page=1) 效果图 ![](https://box.kancloud.cn/f72f2f383051668c8c1fd86b9cf76653_790x532.gif) 源码: ``` ;;by Gu\_xl (defun c:ng:scale (/ sc a b temp) (if (null oldscale) (setq oldscale 2.0)) (initget 6) (setq sc (getreal (strcat "\\n缩放倍数<" (rtos oldscale 2 2)">:"))) (if (null sc) (setq sc oldscale) (setq oldscale sc)) (while (ssget) (vlax-for obj (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object))) (if (not (VL-CATCH-ALL-ERROR-P (VL-CATCH-ALL-APPLY 'vla-GetBoundingBox (list obj 'a 'b)))) (progn (vla-ScaleEntity obj (vlax-3d-point (mapcar '\* '(0.5 0.5 0.5) ;;这是原作者的写法 ; (apply 'mapcar ; (cons '+ ; (mapcar 'vlax-safearray->list (list a b))) ; ) ;;这是修改后的写法 (mapcar '+ (car (setq temp (mapcar 'vlax-safearray->list (list a b)))) (cadr temp) ) ) ) sc ) ) ) ) ) (princ) ) ```