CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

Lineweight 属性 (ActiveX)

2024-5-18 19:08| 发布者: admin| 查看: 133| 评论: 0|原作者: admin|来自: AutoCAD

Lineweight 属性 (ActiveX)

指定单个对象的线宽或图形的默认线宽。

支持的平台:仅限 Windows

签名

VBA:

object.Lineweight
对象

类型:所有图形对象DatabasePreferences、Layer、SubDMeshEdgeSubDMeshFaceSubDMeshVertexSubEntitySubEntSolidEdgeSubEntSolidFaceSubEntSolidNodeSubEntSolidVertex

此属性应用于的对象。

属性值

只读:否(对象除外)Group

类型:枚举acLineWeight

  • acLnWtByLayer
  • acLnWtByBlock
  • acLnWtByLwDefault
  • acLnWt000
  • acLnWt005
  • acLnWt009
  • acLnWt013
  • acLnWt015
  • acLnWt018
  • acLnWt020
  • acLnWt025
  • acLnWt030
  • acLnWt035
  • acLnWt040
  • acLnWt050
  • acLnWt053
  • acLnWt060
  • acLnWt070
  • acLnWt080
  • acLnWt090
  • acLnWt100
  • acLnWt106
  • acLnWt120
  • acLnWt140
  • acLnWt158
  • acLnWt200
  • acLnWt211

言论

此属性的初始值为 。acLnWtByBlock

线宽值由标准设置组成,包括 BYLAYER、BYBLOCK 和 DEFAULT。DEFAULT 值由 LWDEFAULT 系统变量设置,默认值为 0.01 in。或 0.25 毫米。所有新对象和图层的默认设置均为 DEFAULT。线宽值 0 以指定绘图设备上可用的最细线宽绘制,并在模型空间中以 1 个像素宽显示。

例子

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

可视化 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)
          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)
          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))))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1   苏公网安备32011402011833)

GMT+8, 2025-3-14 06:43

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部