疑似bug
<p>各位领导:</p><p>附件是一段AutoCAD2004帮助文件中的例子。打开附件可见一行中文说明,即是我发现的问题,恳请各位赐教。</p><p>这个例子是个VBA程序,讲解TextAlignment是如何工作的,然而当我改变文字的插入点为(0,0)是,程序居然得不到预期结果。这可是官方例子啊!</p><p>先谢了!</p> <p>咋没看到附件?</p><p>Sub Example_TextAlignmentPoint()<br/> ' This example creates a text object in model space.<br/> ' It then changes the TextAlignmentPoint and HorizontalAlignment<br/> ' properties of the text object.</p><p> Dim textObj As AcadText<br/> Dim textString As String<br/> Dim insertionPoint(0 To 2) As Double<br/> Dim height As Double<br/> <br/> ' Define the text object<br/> textString = "Hello, World."<br/> insertionPoint(0) = 3: insertionPoint(1) = 3: insertionPoint(2) = 0<br/> '如果把上一行的两个坐标值3和3都改为0,则修改对齐方式后的文本就显示不出来<br/> height = 0.5<br/> <br/> ' Create the text object in model space<br/> Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)<br/> ZoomAll<br/> MsgBox "The TextAlignmentPoint is set to the default " & textObj.TextAlignmentPoint(0) & ", " & textObj.TextAlignmentPoint(1) & ", " & textObj.TextAlignmentPoint(2), vbInformation, "TextAlignmentPoint Example"<br/> <br/> ' Change the value of the HorizontalAlignment and<br/> ' TextAlignmentPoint properties.<br/> ' Note that the HorizontalAlignment property must be changed first,<br/> ' and to a value that requires the TextAlignmentPoint, before the<br/> ' TextAlignmentPoint property will allow a value to be set.<br/> Dim alignmentPoint(0 To 2) As Double<br/> alignmentPoint(0) = 5: alignmentPoint(1) = 3: alignmentPoint(2) = 0<br/> textObj.HorizontalAlignment = acHorizontalAlignmentFit<br/> textObj.TextAlignmentPoint = alignmentPoint<br/> ZoomAll<br/> MsgBox "The TextAlignmentPoint is set to " & textObj.TextAlignmentPoint(0) & ", " & textObj.TextAlignmentPoint(1) & ", " & textObj.TextAlignmentPoint(2) & vbCrLf & "The HorizontalAlignment is set to acHorizontalAlignmentFit", vbInformation, "TextAlignmentPoint Example"<br/> <br/>End Sub<br/></p>
页:
[1]