szuki 发表于 2009-10-23 21:35:00

[求助]cad有多个layout时,如何指定每个layout?

<p>thisdrawing.paperspace.add....</p><p>如果我有layout1,layout2等,paperspace只默认指定一个.</p>

szuki 发表于 2009-10-23 21:45:00

<p>Option Explicit</p><p>Public Sub Add_Order_Number()</p><p>Dim dblStart(0 To 2) As Double&nbsp; '插入点<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"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '测试用,最终会改为变量</p><p>Set objOrderText = ThisDrawing.PaperSpace.AddText(strText, dblStart, dblHeight)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '在paperspace写字,但有2个以上的layout时,如何每个都写入?</p><p><br/>With objOrderText<br/>&nbsp;&nbsp;&nbsp; .Alignment = acAlignmentMiddleCenter<br/>&nbsp;&nbsp;&nbsp; .TextAlignmentPoint = dblStart&nbsp; '调整该对齐属性的文字插入点(必须)<br/>End With</p><p>objOrderText.Update</p><p>End Sub</p>

szuki 发表于 2009-10-24 19:07:00

继续等待大侠帮忙.

Saging 发表于 2009-10-24 19:33:00

Public Sub mtest() '循环每个空间<br/>&nbsp;&nbsp;&nbsp; Dim mLayout As AcadLayout<br/>&nbsp;&nbsp;&nbsp; For Each mLayout In ThisDrawing.Layouts<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ThisDrawing.ActiveLayout = mLayout<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox ("当前空间为" &amp; mLayout.Name)<br/>&nbsp;&nbsp;&nbsp; Next<br/>End Sub<br/>

szuki 发表于 2009-10-25 09:20:00

<p>ok,测试成功,就是把modelspace也算进去了</p><p></p><p>那么,直接用ThisDrawing.PaperSpace 指定不行么,好像</p>
页: [1]
查看完整版本: [求助]cad有多个layout时,如何指定每个layout?