[求助]cad有多个layout时,如何指定每个layout?
<p>thisdrawing.paperspace.add....</p><p>如果我有layout1,layout2等,paperspace只默认指定一个.</p> <p>Option Explicit</p><p>Public Sub Add_Order_Number()</p><p>Dim dblStart(0 To 2) As Double '插入点<br/>Dim dblHeight As Double<br/>Dim strText As String<br/>Dim objOrderText As AcadText<br/>Dim PP As Object</p><p>dblStart(0) = 338.5473<br/>dblStart(1) = 27.3814<br/>dblStart(2) = 0</p><p>dblHeight = 4.8</p><p>strText = "订单:72E172A,B,C" '测试用,最终会改为变量</p><p>Set objOrderText = ThisDrawing.PaperSpace.AddText(strText, dblStart, dblHeight) '在paperspace写字,但有2个以上的layout时,如何每个都写入?</p><p><br/>With objOrderText<br/> .Alignment = acAlignmentMiddleCenter<br/> .TextAlignmentPoint = dblStart '调整该对齐属性的文字插入点(必须)<br/>End With</p><p>objOrderText.Update</p><p>End Sub</p> 继续等待大侠帮忙. Public Sub mtest() '循环每个空间<br/> Dim mLayout As AcadLayout<br/> For Each mLayout In ThisDrawing.Layouts<br/> ThisDrawing.ActiveLayout = mLayout<br/> MsgBox ("当前空间为" & mLayout.Name)<br/> Next<br/>End Sub<br/> <p>ok,测试成功,就是把modelspace也算进去了</p><p></p><p>那么,直接用ThisDrawing.PaperSpace 指定不行么,好像</p>
页:
[1]