指定单个对象的线宽或绘图的默认线宽。 支持的平台:仅窗口 签名工 务 局: object.Lineweight
属性值只读:不 类型:枚举acLineWeight
言论此属性的初始值为。acLnWtByBlock 线宽值由标准设置组成,包括 BYLAYER、BYBLOCK 和 DEFAULT。默认值由 LWDEFAULT 系统变量设置,默认为 0.01 英寸或 0.25 毫米。所有新对象和图层的默认设置均为“默认”。线宽值 0 在指定打印设备上可用的最细线宽处绘制,并在模型空间中以一个像素宽显示。 例子工 务 局: 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))))
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-11-29 10:33
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.