Option Explicit Public Sub Add_Order_Number() Dim dblStart(0 To 2) As Double '插入点 Dim dblHeight As Double Dim strText As String Dim objOrderText As AcadText Dim PP As Object dblStart(0) = 338.5473 dblStart(1) = 27.3814 dblStart(2) = 0 dblHeight = 4.8 strText = "订单:72E172A,B,C" '测试用,最终会改为变量 Set objOrderText = ThisDrawing.PaperSpace.AddText(strText, dblStart, dblHeight) '在paperspace写字,但有2个以上的layout时,如何每个都写入? With objOrderText .Alignment = acAlignmentMiddleCenter .TextAlignmentPoint = dblStart '调整该对齐属性的文字插入点(必须) End With
objOrderText.Update End Sub |