LinetypeScale プロパティ(ActiveX)

オブジェクトの線種尺度を指定します。

サポートされているプラットフォーム: Windows のみ

構文と要素

VBA:

object.LinetypeScale
object

タイプ: すべての図形オブジェクトAttributeReferenceGroupSubDMeshEdgeSubDMeshFaceSubDMeshVertexSubEntitySubEntSolidEdgeSubEntSolidFaceSubEntSolidNodeSubEntSolidVertex

このプロパティが適用されるオブジェクト。

プロパティの値

読み込み専用: いいえ(書き込み専用の Group オブジェクトを除く)

タイプ: 倍精度浮動小数点数型

この値は正の実数でなければなりません。既定値は 1.0。

注意

オブジェクトの線種尺度は、作図単位に対するダッシュ ドット パターンの相対的な長さを指定します。

VBA:

Sub Example_LinetypeScale()
    ' This example creates a line and finds the linetype scale
    ' for the line. It then changes the linetype scale, and finally
    ' resets the linetype scale back to the original value.
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    Dim lineObj As AcadLine
    Dim currLTScale As Double

    ' Create a Line object in model space
    startPoint(0) = 2#: startPoint(1) = 2#: startPoint(2) = 0#
    endPoint(0) = 4#: endPoint(1) = 4#: endPoint(2) = 0#
    Set lineObj = ThisDrawing.ModelSpace.AddLine(startPoint, endPoint)
    lineObj.Update
    currLTScale = lineObj.LinetypeScale
    MsgBox "The linetype scale for the line is: " & lineObj.LinetypeScale, vbInformation, "Linetypes Example"

    ' Set the linetype scale of a Line to .5
    lineObj.LinetypeScale = 0.5
    lineObj.Update
    MsgBox "The new linetype scale for the line is: " & lineObj.LinetypeScale, vbInformation, "Linetypes Example"
    
    ' Reset the linetype scale of a Line to what is was before
    lineObj.LinetypeScale = currLTScale
    lineObj.Update
    MsgBox "The linetype scale for the line is reset to: " & lineObj.LinetypeScale, vbInformation, "Linetypes Example"
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_LinetypeScale()
    ;; This example creates a line and finds the linetype scale
    ;; for the line. It then changes the linetype scale, and finally
    ;; resets the linetype scale back to the original value.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Create a Line object in model space
    (setq startPoint (vlax-3d-point 2 2 0)
          endPoint (vlax-3d-point 4 4 0))
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq lineObj (vla-AddLine modelSpace startPoint endPoint))
    (vla-Update lineObj)
  
    (setq currLTScale (vla-get-LinetypeScale lineObj))
    (alert (strcat "The linetype scale for the line is: " (rtos currLTScale 2)))

    ;; Set the linetype scale of a Line to .5
    (vla-put-LinetypeScale lineObj 0.5)
    (vla-Update lineObj)
    (alert (strcat "The new linetype scale for the line is: " (rtos (vla-get-LinetypeScale lineObj) 2)))
    
    ;; Reset the linetype scale of a Line to what is was before
    (vla-put-LinetypeScale lineObj currLTScale)
    (vla-Update lineObj)
    (alert (strcat "The linetype scale for the line is reset to: " (rtos (vla-get-LinetypeScale lineObj) 2)))
)