CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2019 开发者帮助

BackgroundFill 属性 (ActiveX)

2024-5-18 17:52| 发布者: admin| 查看: 122| 评论: 0|原作者: admin|来自: AutoCAD

BackgroundFill 属性 (ActiveX)

指定多行文本是否具有背景填充。

支持的平台:仅限 Windows

签名

VBA:

object.BackgroundFill
对象

类型:GeoPositionMarkerMText

此属性应用于的对象。

属性值

只读:

类型:布尔

  • True:启用后台填充。
  • False:背景填充已禁用。

言论

MText:此属性中包含的值是“属性”选项板中的“背景掩码”属性。

例子

VBA:

Sub Example_BackgroundFill()
    ' This example creates a circle and an MText object, and masks part of the 
    ' circle with the MText object

    'Draw a circle
    Dim circleObj As AcadCircle
    Dim CircleReference(0 To 2) As Double
    Dim radius As Double
    CircleReference(0) = 0
    CircleReference(1) = 0
    CircleReference(2) = 0
    radius = 5
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(CircleReference, radius)
    ZoomAll
    MsgBox "A circle has been drawn."
    
    'Create an MText object with the BackgroundFill property set to True
    Dim MTextObj As AcadMText
    Dim width As Double
    Dim text As String
    width = 10
    text = "This is the text for the MText object"
    Set MTextObj = ThisDrawing.ModelSpace.AddMText(CircleReference, width, text)
    MTextObj.BackgroundFill = True
    ZoomAll
    
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_BackgroundFill()
    ;; This example creates a circle and an MText object, and masks part of the 
    ;; circle with the MText object
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Draw a circle
    (setq CircleReference (vlax-3d-point 0 0 0)
          radius 0.5)
    (setq modelSpace (vla-get-ModelSpace doc))  
    (setq circleObj (vla-AddCircle modelSpace CircleReference radius))
    (vla-ZoomAll acadObj)
    (alert "A circle has been drawn.")
    
    ;; Create an MText object with the BackgroundFill property set to True
    (setq width 5
          text "This is the text for the MText object")
    (setq MTextObj (vla-AddMText modelSpace CircleReference width text))
    (vla-put-AttachmentPoint MTextObj 5)
    (vla-put-InsertionPoint MTextObj CircleReference)
    (vla-put-BackgroundFill MTextObj :vlax-true)
    (vla-ZoomAll acadObj)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2025-3-5 15:36

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部