Lineweight Property (ActiveX)

Specifies the lineweight of an individual object or the default lineweight for the drawing.

Supported platforms: Windows only

Signature

VBA:

object.Lineweight
object

Type: All drawing objects, DatabasePreferences, Layer, SubDMeshEdge, SubDMeshFace, SubDMeshVertex, SubEntity, SubEntSolidEdge, SubEntSolidFace, SubEntSolidNode, SubEntSolidVertex

The objects this property applies to.

Property Value

Read-only: No

Type: acLineWeight enum

Remarks

The initial value for this property is acLnWtByBlock.

Lineweight values consist of standard settings including BYLAYER, BYBLOCK, and DEFAULT. The DEFAULT value is set by the LWDEFAULT system variable and defaults to a value of 0.01 in. or 0.25 mm. All new objects and layers have a default setting of DEFAULT. The lineweight value of 0 plots at the thinnest lineweight available on the specified plotting device and is displayed at one pixel wide in model space.

Examples

VBA:

Sub Example_LineWeight()
    ' This example creates a circle in model space and then
    ' finds the current lineweight for the circle. The lineweight
    ' is then changed to a new value.
   
    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    
    ' Define the circle
    centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
    radius = 5#
    
    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
    ZoomAll
    
    ' Find the lineweight for the circle
    MsgBox "The current lineweight for the circle is " & circleObj.Lineweight
    
    ' Change the lineweight for the circle
    circleObj.Lineweight = acLnWt211
    circleObj.Update
    MsgBox "The current lineweight for the circle is " & circleObj.Lineweight
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_LineWeight()
    ;; This example creates a circle in model space and then
    ;; finds the current lineweight for the circle. The lineweight
    ;; is then changed to a new value.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the circle
    (setq centerPoint (vlax-3d-point 0 0 0)
          radius 5)
    
    ;; Create the Circle object in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq circleObj (vla-AddCircle modelSpace centerPoint radius))
    (vla-ZoomAll acadObj)
    
    ;; Find the lineweight for the circle
    (alert (strcat "The current lineweight for the circle is " (itoa (vla-get-Lineweight circleObj))))
    
    ;; Change the lineweight for the circle
    (vla-put-Lineweight circleObj acLnWt211)
    (vla-Update circleObj)
    (alert (strcat "The current lineweight for the circle is " (itoa (vla-get-Lineweight circleObj))))
)