CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2019 开发者帮助

LastHeight 属性 (ActiveX)

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

LastHeight 属性 (ActiveX)

指定上次使用的文本高度。

支持的平台:仅限 Windows

签名

VBA:

object.LastHeight
对象

类型:TextStyle

此属性应用于的对象。

属性值

只读:

类型:

用于文本样式的最后一个文本高度。

言论

没有其他评论。

例子

VBA:

Sub Example_LastHeight()
    ' This example finds the current value for LastHeight.
    ' It then changes that value, and resets it again.

    Dim txtStyleObj As AcadTextStyle
    Set txtStyleObj = ThisDrawing.ActiveTextStyle
    
    ' Set and retrieve the LastHeight property
    Dim currHeight As Double
    Dim newHeight As Double
    
    ' Retrieve current LastHeight property
    currHeight = txtStyleObj.lastHeight
    MsgBox "The current value for LastHeight is " & txtStyleObj.lastHeight, , "LastHeight Example"
    
    ' Set LastHeight to a new value
    txtStyleObj.lastHeight = 4#
    
    ' Retrieve the current LastHeight value
    newHeight = txtStyleObj.lastHeight
    MsgBox "The new value for LastHeight is " & txtStyleObj.lastHeight, , "LastHeight Example"
    
    ' Finally reset LastHeight to its default value
    txtStyleObj.lastHeight = currHeight
    MsgBox "The value for LastHeight has been reset to " & txtStyleObj.lastHeight, , "LastHeight Example"
    
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_LastHeight()
    ;; This example finds the current value for LastHeight.
    ;; It then changes that value, and resets it again.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    (setq txtStyleObj (vla-get-ActiveTextStyle doc))
    
    ;; Set and retrieve the LastHeight property
    ;; Retrieve current LastHeight property
    (setq currHeight (vla-get-LastHeight txtStyleObj))
    (alert (strcat "The current value for LastHeight is " (rtos currHeight 2)))
    
    ;; Set LastHeight to a new value
    (vla-put-LastHeight txtStyleObj 4)
    
    ;; Retrieve the current LastHeight value
    (setq newHeight (vla-get-LastHeight txtStyleObj))
    (alert (strcat "The new value for LastHeight is " (rtos newHeight 2)))
    
    ;; Finally reset LastHeight to its default value
    (vla-put-LastHeight txtStyleObj currHeight)
    (alert (strcat "The value for LastHeight has been reset to " (rtos currHeight 2)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-12-15 11:26

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部