Lineweight 属性 (ActiveX)
指定单个对象的线宽或图形的默认线宽。 支持的平台:仅限 Windows 签名VBA: object.Lineweight 属性值只读:否(对象除外)Group 类型:枚举acLineWeight
言论此属性的初始值为 。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)))) ) |
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-3-14 06:43
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.