本帖最后由 Gu_xl 于 2013-12-10 11:02 编辑
实体原位缩放 By Gu_xl
- (defun c:tt (/ sc a b)
- (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))))))
- sc
- )
- )
- )
- )
- )
- (princ)
- )
|