求助:关于文字对齐的问题
请高手帮忙看看我下面的代码:On Error Resume Next<BR> Dim sstext As AcadSelectionSet<BR> Dim FilterType(0) As Integer<BR> Dim FilterData(0) As Variant<BR> Dim nInsertionPoint(2)<BR><BR> ThisDrawing.Utility.Prompt ("选择你要求排序的文本:")<BR> Set sstext = ThisDrawing.SelectionSets.Add("SSS1")<BR> If ERR Then<BR> ERR.Clear<BR> Set sstext = ThisDrawing.SelectionSets.Item("SSS1")<BR> End If<BR> sstext.Clear<BR> FilterType(0) = 0<BR> FilterData(0) = "TEXT"
sstext.SelectOnScreen FilterType, FilterData<BR> <BR> nInsertionPoint(0) = 90: nInsertionPoint(1) = 30: nInsertionPoint(2) = 0<BR> <BR> Dim entry As AcadEntity<BR> For Each entry In sstext<BR> entry.Alignment = acAlignmentCenter<BR> entry.TextAlignmentPoint = nInsertionPoint<BR> entry.Update<BR> Next entry
怎么不能改变文本的对象点?谢谢了。 Dim nInsertionPoint(2) as double 改这一句:<BR> Dim nInsertionPoint(2) As Double<BR> 有意思,这个错误我也有过阿,当时花了好长时间才找到出错的原因。 做一个子程解决这个问题,调用格式: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#)<BR> <BR> Dim pnt(2) As Double<BR> pnt(0) = X: pnt(1) = Y: pnt(2) = Z<BR> <BR> CreatePoint = pnt<BR> <BR>End Function<BR> 谢谢斑竹,确实是这个问题。
解决了。
页:
[1]