LinetypeScale Property (ActiveX)

Specifies the linetype scale of an object.

Supported platforms: Windows only

Signature

VBA:

object.LinetypeScale
object

Type: All drawing objects, AttributeReference, Group, SubDMeshEdge, SubDMeshFace, SubDMeshVertex, SubEntity, SubEntSolidEdge, SubEntSolidFace, SubEntSolidNode, SubEntSolidVertex

The objects this property applies to.

Property Value

Read-only: No; except for a Group object which is write-only

Type: Double

This value must be a positive real number. The default is 1.0.

Remarks

The linetype scale of an object specifies the relative length of dash-dot linetypes per drawing unit.

Examples

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)))
)