CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

TextGenerationFlag Property (ActiveX)

2023-1-3 04:07| 发布者: admin| 查看: 195| 评论: 0|来自: AutoCAD

摘要: 指定属性文本生成标志。

指定属性文本生成标志。

支持的平台:仅窗口

签名

工 务 局:

object.TextGenerationFlag
对象

类型:属性,属性引用,文本,文本样式

此属性适用的对象。

属性值

只读:

类型:枚举acTextGenerationFlag

  • acTextFlagBackward
  • acTextFlagUpsideDown

言论

若要指定这两个标志,请将它们加在一起。

例子

工 务 局:

Sub Example_TextGenerationFlag()
    ' This example creates a text object in model space.
    ' It then changes the TextGenerationFlag of the text object.

    Dim textObj As AcadText
    Dim textString As String
    Dim insertionPoint(0 To 2) As Double
    Dim height As Double
    
    ' Define the text object
    textString = "Hello, World."
    insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0
    height = 0.5
    
    ' Create the text object in model space
    Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)
    ZoomAll
    MsgBox "The TextGenerationFlag has not been set.", vbInformation, "TextGenerationFlag Example"
    
    ' Change the value of the TextGenerationFlag
    textObj.TextGenerationFlag = acTextFlagBackward
    ZoomAll
    MsgBox "The TextGenerationFlag is set to acTextFlagBackward.", vbInformation, "TextGenerationFlag Example"
    
    textObj.TextGenerationFlag = acTextFlagUpsideDown
    ZoomAll
    MsgBox "The TextGenerationFlag is set to acTextFlagUpsideDown.", vbInformation, "TextGenerationFlag Example"
    
    textObj.TextGenerationFlag = acTextFlagBackward + acTextFlagUpsideDown
    ZoomAll
    MsgBox "The TextGenerationFlag is set to acTextFlagBackward + acTextFlagUpsideDown.", vbInformation, "TextGenerationFlag Example"
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_TextGenerationFlag()
    ;; This example creates a text object in model space.
    ;; It then changes the TextGenerationFlag of the text object.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define the text object
    (setq insertionPoint (vlax-3d-point 3 3 0)  
          textString "Hello, World."
          height 0.5)
    
    ;; Create the text object in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq textObj (vla-AddText modelSpace textString insertionPoint height))  
    (vla-ZoomAll acadObj)

    (alert "The TextGenerationFlag has not been set.")
    
    ;; Change the value of the TextGenerationFlag
    (vla-put-TextGenerationFlag textObj acTextFlagBackward)
    (vla-ZoomAll acadObj)
    (alert "The TextGenerationFlag is set to acTextFlagBackward.")
    
    (vla-put-TextGenerationFlag textObj acTextFlagUpsideDown)
    (vla-ZoomAll acadObj)
    (alert "The TextGenerationFlag is set to acTextFlagUpsideDown.")
    
    (vla-put-TextGenerationFlag textObj (+ acTextFlagBackward acTextFlagUpsideDown))
    (vla-ZoomAll acadObj)
    (alert "The TextGenerationFlag is set to acTextFlagBackward + acTextFlagUpsideDown.")
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-19 16:16

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部