乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 67|回复: 2

请大家帮我一下,是关于文本对齐方面的问题

[复制链接]

25

主题

61

帖子

6

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
161
发表于 2003-5-2 18:28:00 | 显示全部楼层 |阅读模式
比如我选了几个文本,我要设置它们的acalignmentmiddleleft 中的X坐标的相同(这一步我能解决),而Y坐标不变(这就有麻烦了),我不知道怎样把原来文本的y坐标调用出来
  我本来是这样写的
   dim oldpt as Variant
   dim nept(0 to 2) as double
   oldpt=ent.ent.TextAlignmentPoint
   nept(1)=oldpt(1)
  “ent是已选中的单行文本”
这样做行不通,请大家帮一下我
回复

使用道具 举报

158

主题

2315

帖子

10

银币

顶梁支柱

Rank: 50Rank: 50

铜币
2951
发表于 2003-5-2 19:34:00 | 显示全部楼层
所以在改变对齐方式后,应该把插入点重新设回原来的插入点,不然文字就会跑到原点上 去。
以下程序你试试:
  1. Sub TextAlignPnt()
  2. Dim pnt As Variant
  3. Dim pnt1 As Variant
  4. Dim pnt2 As Variant
  5. Dim obj As AcadEntity
  6. Dim txt As AcadText
  7. ThisDrawing.Utility.GetEntity obj, pnt1, "Select Text:"
  8. If obj.ObjectName = "AcDbText" Then
  9.     Set txt = obj
  10.     pnt = txt.InsertionPoint
  11.     Debug.Print "Insertionpoint=" & pnt(0) & " " & pnt(1) & " "; pnt(2)
  12.     txt.Alignment = acAlignmentMiddleLeft
  13.     pnt1 = txt.TextAlignmentPoint
  14.     txt.InsertionPoint = pnt
  15.     Debug.Print "Alignmentpoint=" & pnt1(0) & " " & pnt1(1) & " "; pnt1(2)
  16. pnt2 = ThisDrawing.Utility.GetPoint(, "Select New Alignment point:")
  17.     Debug.Print "Selectpoint=" & pnt2(0) & " " & pnt2(1) & " "; pnt2(2)
  18.     pnt1(0) = pnt2(0)
  19.     txt.TextAlignmentPoint = pnt1
  20.     ThisDrawing.Application.Update
  21. End If
  22. End Sub
回复

使用道具 举报

25

主题

61

帖子

6

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
161
发表于 2003-5-2 21:51:00 | 显示全部楼层
让我先试一下
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-13 13:53 , Processed in 0.505343 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表