CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

线宽属性 (ActiveX)

2023-1-3 11:52| 发布者: admin| 查看: 400| 评论: 0|来自: AutoCAD

摘要: 指定单个对象的线宽或绘图的默认线宽。

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

支持的平台:仅窗口

签名

工 务 局:

object.Lineweight
对象

类型:所有图形对象数据库首选项图层子DMeshEdge,SubDMeshFace,SubDMeshVertexSubEntitySubEntSolidEdgeSubEntSolidFaceSubEntSolidNode,SubEntSolidVertex

此属性适用的对象。

属性值

只读:

类型:枚举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。默认值由 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))))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 17:39

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部