Scales an object equally in the X, Y, and Z directions.
Supported platforms: Windows only
VBA:
object.ScaleEntity BasePoint, ScaleFactor
Type: All drawing objects, AttributeReference, Dimension
The objects this method applies to.
Access: Input-only
Type: Variant (three-element array of doubles)
The 3D WCS coordinates specifying the base point.
Access: Input-only
Type: Double
The factor by which to scale the object. The dimensions of the object are multiplied by the scale factor. A scale factor greater than 1 enlarges the object. A scale factor between 0 and 1 reduces the object. The scale factor must be greater than 0.0.
No return value.
ScaleFactor = 0.5 and ScaleFactor = 2
VBA:
Sub Example_ScaleEntity() ' This example creates a lightweight polyline ' and then scales that polyline. ' Create the polyline Dim plineObj As AcadLWPolyline Dim points(0 To 11) As Double points(0) = 1: points(1) = 2 points(2) = 1: points(3) = 3 points(4) = 2: points(5) = 3 points(6) = 3: points(7) = 3 points(8) = 4: points(9) = 4 points(10) = 4: points(11) = 2 Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points) plineObj.Closed = True ZoomAll MsgBox "Scale the polyline by 0.5", , "ScaleEntity Example" ' Define the scale Dim basePoint(0 To 2) As Double Dim scalefactor As Double basePoint(0) = 4: basePoint(1) = 4.25: basePoint(2) = 0 scalefactor = 0.5 ' Scale the polyline plineObj.ScaleEntity basePoint, scalefactor ZoomAll MsgBox "Scale completed.", , "ScaleEntity Example" End Sub
Visual LISP:
(vl-load-com) (defun c:Example_ScaleEntity() ;; This example creates a lightweight polyline ;; and then scales that polyline. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Create the polyline (setq points (vlax-make-safearray vlax-vbDouble '(0 . 11))) (vlax-safearray-fill points '(1 2 1 3 2 3 3 3 4 4 4 2 ) ) (setq modelSpace (vla-get-ModelSpace doc)) (setq plineObj (vla-AddLightWeightPolyline modelSpace points)) (vla-put-Closed plineObj :vlax-true) (vla-ZoomAll acadObj) (alert "Scale the polyline by 0.5") ;; Define the scale (setq basePoint (vlax-3d-point 4 4.25 0) scalefactor 0.5) ;; Scale the polyline (vla-ScaleEntity plineObj basePoint scalefactor) (vla-ZoomAll acadObj) (alert "Scale completed.") )