- 积分
- 1147
- 明经币
- 个
- 注册时间
- 2004-8-4
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2005-4-19 10:16:00
|
显示全部楼层
Sub Example_TextPosition() Dim dimObj As AcadDimAligned Dim point1(0 To 2) As Double Dim point2(0 To 2) As Double Dim location(0 To 2) As Double '定义标注 point1(0) = 5#: point1(1) = 3#: point1(2) = 0# point2(0) = 10#: point2(1) = 3#: point2(2) = 0# location(0) = 7.5: location(1) = 5#: location(2) = 0# Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location) '下面的三个属性设置文字的排列格式 dimObj.TextInside = False dimObj.TextOutsideAlign = False dimObj.TextMovement = acMoveTextAddLeader ZoomExtents Debug.Print "The current text position for the dimension is " _ & dimObj.TextPosition(0) & ", " _ & dimObj.TextPosition(1) & ", " _ & dimObj.TextPosition(2) '这里可以指定文字最后的位置 location(0) = 15: location(1) = 10: location(2) = 0 dimObj.TextPosition = location dimObj.Update ZoomExtents Dim retPoint As Variant retPoint = dimObj.TextPosition Debug.Print "The new text position for the dimension is " _ & dimObj.TextPosition(0) & ", " _ & dimObj.TextPosition(1) & ", " _ & dimObj.TextPosition(2) End Sub 以上程序代码大部分来自于AutoCAD的帮助系统。我觉得那里面很全面的,语法的知识很丰富,有时间多看看吧。 |
|