这将以其中心处的基点缩放正方形。
- (defun c:scl (/ ss scl st 3p)
- (vl-load-com)
- (or scale:def (setq scale:def 0.)
- (if (setq ss (ssget
- (list (cons 0 "*Polyline")
- (cons 8 "Columns")
- (if (getvar "CTAB")
- (cons 410 (getvar "CTAB"))
- (cons 67 (- 1 (getvar "TILEMODE")))))))
- (progn
- (initget 6)
- (setq scl (getreal (strcat "\nSpecify Scale Factor <" (rtos scale:def) "> : ")))
- (or (not scl) (setq scale:def scl))
- (foreach x (mapcar 'vlax-ename->vla-object
- (mapcar 'cadr (ssnamex ss)))
- (setq st (vlax-curve-getStartPoint x)
- 3p (vlax-curve-getPointatParam x 2.0))
- (vla-scaleEntity x
- (vlax-3D-point
- (polar st (angle st 3p) (/ (distance st 3p) 2.0))) scale:def)))
- (princ "\n<!> No Lines Found <!>"))
- (princ))
尽管如此,它还是做出了很多假设——比如它们是完全正方形的,等等 |