常用材料表格式。
Sub MaterialTitle()<br/> Dim cadApp As AcadApplication<br/> Set cadApp = ConnectCad<br/> Dim xArr, textTitle, heightTitle, materialRow<br/> xArr = Array(0, 20, 50, 97, 107, 137, 148.5, 160, 171.5, 180)<br/> textitle = Array("件 号", "图号或标准号", "名 称", "数量", "材 料", "单", "总", "质 量(kg)", "备 注")<br/> Dim pp0(2) As Double, pp1(2) As Double<br/> materialRow = 13<br/> 'heightTitle = 14 + 8 * materialRow<br/> pp1(0) = 180<br/> With cadApp.ActiveDocument.ModelSpace<br/> For ii = 0 To materialRow + 2<br/> If ii = 0 Then<br/> heightTitle = 0<br/> ElseIf ii = 1 Then<br/> heightTitle = 14<br/> Else<br/> heightTitle = heightTitle + 8<br/> End If<br/> <br/> pp0(1) = heightTitle:<br/> pp1(1) = pp0(1)<br/> Set objLine = .AddLine(pp0, pp1)<br/> Next ii<br/> ''<br/> Dim p0(2) As Double, p1(2) As Double<br/> p0(1) = 0: p1(1) = heightTitle<br/> For jj = 0 To UBound(xArr)<br/> p0(0) = xArr(jj): p1(0) = p0(0)<br/> Set objLine = .AddLine(p0, p1)<br/> Next jj<br/> End With<br/>End Sub<br/> Set cadApp = Conne 错误要求对象怎么回事
页:
[1]