Description 属性 (ActiveX)
指定对象的说明。 支持的平台:仅限 Windows 签名VBA: object.Description
属性值只读:
类型:字符串 分配给对象的描述。 言论动态块引用属性的描述由块作者设置,无法编辑。 线型描述最多可以包含 47 个字符。描述可以是注释,也可以是一系列下划线、点、破折号和空格,以显示线型模式的简单表示形式。 例子VBA: Sub Example_Description()
' This example returns the description of the active linetype.
' It then changes the description of the active linetype.
Dim currDescription As String
' This example modifies the description of a linetype
currDescription = ThisDrawing.ActiveLinetype.Description
MsgBox "The description of the active LineType is: " & currDescription, vbInformation, "Description Example"
' Change the description of the active linetype
ThisDrawing.ActiveLinetype.Description = "My favorite LineType"
MsgBox "The new description of the active LineType is: " & ThisDrawing.ActiveLinetype.Description, vbInformation, "Description Example"
' Reset the description of the active linetype
ThisDrawing.ActiveLinetype.Description = currDescription
MsgBox "The description of the active LineType is reset to: " & ThisDrawing.ActiveLinetype.Description, vbInformation, "Description Example"
End Sub
可视化 LISP: (vl-load-com)
(defun c:Example_Description()
;; This example returns the description of the active linetype.
;; It then changes the description of the active linetype.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; This example modifies the description of a linetype
(setq currDescription (vla-get-Description (vla-get-ActiveLinetype doc)))
(alert (strcat "The description of the active Linetype is: " currDescription))
;; Change the description of the active linetype
(vla-put-Description (vla-get-ActiveLinetype doc) "My favorite LineType")
(alert (strcat "The new description of the active Linetype is: " (vla-get-Description (vla-get-ActiveLinetype doc))))
;; Reset the description of the active linetype
(vla-put-Description (vla-get-ActiveLinetype doc) currDescription)
(alert (strcat "The description of the active Linetype is reset to: " currDescription))
)
|
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-11-3 00:44
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.