オブジェクトの尺度を指定します。
サポートされているプラットフォーム: Windows のみ
VBA:
object.ScaleFactor
タイプ: Attribute、AttributeReference、DgnUnderlay、Dim3PointAngular、DimAligned、DimAngular、DimArcLength、DimDiametric、Dimension、DimOrdinate、DimRadial、DimRadialLarge、DimRotated、DwfUnderlay、GeomapImage、Leader、MLeader、MLeaderStyle、PdfUnderlay、RasterImage、Shape、Text、Tolerance、Wipeout
このプロパティが適用されるオブジェクト。
読み込み専用: いいえ
タイプ: 倍精度浮動小数点数型(CAD_NOUNITS)
0.0 よりも大きい実数。尺度係数が 1 より大きいと、オブジェクトは拡大されます。尺度係数が 1 より小さい(ただし 0 より大きい)と、オブジェクトは縮小します。
このプロパティの初期値は 1.0000 です。
尺度係数はしばしば、相対 X 倍率と呼ばれます。 尺度係数はオブジェクトの幅に適用され、高さとは別に幅だけを調整できます。たとえば、尺度係数を 0.8 に指定すると、オブジェクトは調整していない通常の幅の 80% の幅で描かれます。
寸法、引出線、幾何公差オブジェクト: このプロパティはシステム変数 DIMSCALE の値を変更します。
ペーパー空間で作業している場合、寸法の尺度は 0.0 に等しく、AutoCAD は現在のモデル空間のビューポートとペーパー空間の間の尺度設定に基づいて適切な既定値を計算します。ペーパー空間の寸法に対する尺度は変更できません。
VBA:
Sub Example_ScaleFactor()
' This example creates a text object in model space.
' It then finds the current scale factor and changes it.
Dim textObj As AcadText
Dim textString As String
Dim insertionPoint(0 To 2) As Double
Dim height As Double
' Define the text object
textString = "Hello, World."
insertionPoint(0) = 2: insertionPoint(1) = 2: insertionPoint(2) = 0
height = 0.5
' Create the text object in model space
Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
ZoomAll
' Find the current scale factor for the text object
Dim currScaleFactor As Double
currScaleFactor = textObj.scalefactor
MsgBox "The scale factor of the text is " & textObj.scalefactor, , "ScaleFactor Example"
' Change the scale factor for the text object
textObj.scalefactor = currScaleFactor + 1
ThisDrawing.Regen True
MsgBox "The scale factor of the text is now " & textObj.scalefactor, , "ScaleFactor Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_ScaleFactor()
;; This example creates a text object in model space.
;; It then finds the current scale factor and changes it.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Define the text object
(setq textString "Hello, World."
insertionPoint (vlax-3d-point 2 2 0)
height 0.5)
;; Create the text object in model space
(setq modelSpace (vla-get-ModelSpace doc))
(setq textObj (vla-AddText modelSpace textString insertionPoint height))
(vla-ZoomAll acadObj)
;; Find the current scale factor for the text object
(setq currScaleFactor (vla-get-Scalefactor textObj))
(alert (strcat "The scale factor of the text is " (rtos currScaleFactor 2)))
;; Change the scale factor for the text object
(vla-put-Scalefactor textObj (1+ currScaleFactor))
(vla-Regen doc :vlax-true)
(alert (strcat "The scale factor of the text is now " (rtos (vla-get-Scalefactor textObj) 2)))
)