请高手帮忙看看我下面的代码:
On Error Resume Next Dim sstext As AcadSelectionSet Dim FilterType(0) As Integer Dim FilterData(0) As Variant Dim nInsertionPoint(2)
ThisDrawing.Utility.Prompt ("选择你要求排序的文本:") Set sstext = ThisDrawing.SelectionSets.Add("SSS1") If ERR Then ERR.Clear Set sstext = ThisDrawing.SelectionSets.Item("SSS1") End If sstext.Clear FilterType(0) = 0 FilterData(0) = "TEXT"
sstext.SelectOnScreen FilterType, FilterData
Dim entry As AcadEntity For Each entry In sstext entry.Alignment = acAlignmentCenter entry.TextAlignmentPoint = nInsertionPoint entry.Update Next entry
怎么不能改变文本的对象点?谢谢了。
做一个子程解决这个问题,调用格式:pnt=createpoint(90,30,0)
Public Function CreatePoint(Optional ByVal X As Double = 0#, Optional ByVal Y As Double = 0#, Optional ByVal Z As Double = 0#)
Dim pnt(2) As Double pnt(0) = X: pnt(1) = Y: pnt(2) = Z