明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1581|回复: 7

VLISP好像(WHY??)没有HorizontalAlignment性质 & VerticalAlignment性质?????

[复制链接]
发表于 2002-12-3 17:08 | 显示全部楼层 |阅读模式
"觉得好,就打赏"
还没有人打赏,支持一下
 楼主| 发表于 2002-12-4 07:56 | 显示全部楼层

在VLIDE接口下VLA-PUT-HORIZONTALALIGNMENT显示它不是函数

发表于 2002-12-4 07:59 | 显示全部楼层

Beacause you are not allowed to change them

发表于 2002-12-3 17:15 | 显示全部楼层

??详细一点吧

 楼主| 发表于 2002-12-4 10:18 | 显示全部楼层

但說明文件上說它是可read-write

Specifies horizontal alignment for the attribute, attribute reference, or text.

Signature

object.HorizontalAlignment

object        Attribute, AttributeRef, Text
The object or objects this property applies to.

HorizontalAlignment        acHorizontalAlignment enum; read-write

acHorizontalAlignmentLeft
acHorizontalAlignmentCenter
acHorizontalAlignmentRight
acHorizontalAlignmentAligned
acHorizontalAlignmentMiddle
acHorizontalAlignmentFit

Remarks

Text aligned to acHorizontalAlignmentLeft uses the InsertionPoint property to position the text.
Text aligned to acHorizontalAlignmentAligned, or acHorizontalAlignmentFit uses both the InsertPoint and TextAlignmentPoint properties to position the text.
Text aligned to any other position uses the TextAlignmentPoint property to position the text.
发表于 2005-11-11 11:06 | 显示全部楼层

我也遇到了这个问题,到底是怎么回事啊?

发表于 2005-11-11 11:07 | 显示全部楼层

龙龙仔,找到答案没有啊?

那位大侠知道为什么那?

发表于 2005-11-11 11:11 | 显示全部楼层

(defun   c:e3()

;;;这个范例在模型空间中建立一个文字对象

;;;接着改变文字对象的 TextAlignmentPoint 和HorizontalAlignment属性

  (VL-LOAD-COM)

  (setq    AcadObject   (vlax-get-acad-object)

       AcadDocument (vla-get-ActiveDocument AcadObject)

       mSpace        (vla-get-ModelSpace AcadDocument)

  )

;;;定义文字对象

  (setq textString "嗨,你好。")

  (setq insertionPnt (vlax-make-safearray vlax-vbDouble '(0 . 2)))

  (vlax-safearray-fill insertionPnt '(30 30 0))

  (setq alignmentPnt (vlax-make-safearray vlax-vbDouble '(0 . 2)))

  (vlax-safearray-fill alignmentPnt '(30 30 0))

  (setq height 5)

;;;在模型空间中建立文字对象

  (setq TextObj (vla-AddText mSpace textString insertionPnt height))

  (vla-ZoomExtents AcadObject)

  (setq currAlignmentPnt (vla-get-TextAlignmentPoint TextObj))

  (setq currAlignmentPnt (vlax-variant-value currAlignmentPnt))

  (princ

    (STRCAT " TextAlignmentPoint 设定默认值: "

           (RTOS (vlax-safearray-get-element currAlignmentPnt 0))

           ", "

           (RTOS (vlax-safearray-get-element currAlignmentPnt 1))

           ", "

           (RTOS (vlax-safearray-get-element currAlignmentPnt 2))

           "    TextAlignmentPoint 范例\n"

    )

  )

  (PROMPT "<Enter>进行:")

  (VL-CMDF pause)

;;;改变HorizontalAlignment 和

;;;TextAlignmentPoint 属性的值

;;;注意,必须将 HorizontalAlignment 属性改变为,

;;;要求TextAlignmentPoint的值,这样

;;;才可以设定TextAlignmentPoint属性的值

  (setq newAlignmentPnt (vlax-make-safearray vlax-vbDouble '(0 . 2)))

  (vlax-safearray-fill newAlignmentPnt '(50 30 0))

  (vla-put-HorizontalAlignment

    TextObj

    acHorizontalAlignmentFit

  )

  (vla-put-TextAlignmentPoint TextObj newAlignmentPnt)

  (vla-ZoomExtents AcadObject)

  (setq newAlignmentPnt (vla-get-TextAlignmentPoint viewPortObj))

  (setq newAlignmentPnt (vlax-variant-value newAlignmentPnt))

  (princ

    (STRCAT "TextAlignmentPoint 设定为: "

           (RTOS (vlax-safearray-get-element newAlignmentPnt 0))

           ", "

           (RTOS (vlax-safearray-get-element newAlignmentPnt 1))

           ", "

           (RTOS (vlax-safearray-get-element newAlignmentPnt 2))

           "\r  \n"

           " HorizontalAlignment 设定为 acHorizontalAlignmentFit"

           "TextAlignmentPoint 范例"

    )

  )

  (princ)

)

 

上面的函数为什么会出错那?

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-20 06:54 , Processed in 0.224600 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表