找回密码
 注册
搜索
查看: 1496|回复: 8

[原理图] PowerLogic 原理图BOM生成Excel或TXT问题

[复制链接]
发表于 2007-1-16 09:05:22 | 显示全部楼层 |阅读模式
在这里的各位应当都是高手,有谁用过PADS2005 Logic生成BOM,我这边一生成就提示内存错误,请大家也帮忙确认,是否是软件问题,谢谢!!
 楼主| 发表于 2007-1-16 09:05:22 | 显示全部楼层 |阅读模式
在这里的各位应当都是高手,有谁用过PADS2005 Logic生成BOM,我这边一生成就提示内存错误,请大家也帮忙确认,是否是软件问题,谢谢!!
发表于 2007-1-16 15:30:00 | 显示全部楼层
软件的BUG,可以使用Basic Scripts来做BOM
Dim xl As Object
Dim row As Integer
Dim part As Object
Sub Main
Set xl = CreateObject("Excel.Application")
xl.Workbooks.Add
xl.Visible = True
Set cell = xl.ActiveCell
row = 2
For Each comp In ActiveDocument.Components
  cell.Item(row, 1) = comp.Name
  cell.Item(row, 2) = comp.PartType
  cell.Item(row, 3) = AttrValue(comp, "PART DESC")
  cell.Item(row, 4) = AttrValue(comp, "MFG. #1")
  cell.Item(row, 5) = AttrValue(comp, "VALUE")
  cell.Item(row, 6) = AttrValue(comp, "TOLERANCE")
  row = row + 1
Next
On Error GoTo 0
xl.Columns("A:F").NumberFormat = "@"
xl.Range("A1:F1") = Array("RefDes","Part Type","Description","Manufacturer","Value","Tolerance")
xl.Range("A1:F1").Font.Bold = True
xl.Range("A1:F1").AutoFilter
'xl.Range("A1").Subtotal GroupBy:=2, Function:=2, TotalList:=Array(2)
xl.Columns("A:F").AutoFit
End Sub
Function AttrValue (comp As Object, atrName As String) As String
If comp.Attributes(atrName) Is Nothing Then
  AttrValue = ""
Else
  AttrValue = comp.Attributes(atrName).value
End If
End Function
点评回复

使用道具 举报

 楼主| 发表于 2007-1-18 08:25:29 | 显示全部楼层
PowerLogic中支持写Basic Scripts吗?没有往这方面想,可以告诉具体如何操作?谢谢!
点评回复

使用道具 举报

 楼主| 发表于 2007-1-23 10:32:43 | 显示全部楼层
谢谢,已OK.
点评回复

使用道具 举报

发表于 2007-1-16 15:30:00 | 显示全部楼层
软件的BUG,可以使用Basic Scripts来做BOM
Dim xl As Object
Dim row As Integer
Dim part As Object
Sub Main
Set xl = CreateObject("Excel.Application")
xl.Workbooks.Add
xl.Visible = True
Set cell = xl.ActiveCell
row = 2
For Each comp In ActiveDocument.Components
  cell.Item(row, 1) = comp.Name
  cell.Item(row, 2) = comp.PartType
  cell.Item(row, 3) = AttrValue(comp, "PART DESC")
  cell.Item(row, 4) = AttrValue(comp, "MFG. #1")
  cell.Item(row, 5) = AttrValue(comp, "VALUE")
  cell.Item(row, 6) = AttrValue(comp, "TOLERANCE")
  row = row + 1
Next
On Error GoTo 0
xl.Columns("A:F").NumberFormat = "@"
xl.Range("A1:F1") = Array("RefDes","Part Type","Description","Manufacturer","Value","Tolerance")
xl.Range("A1:F1").Font.Bold = True
xl.Range("A1:F1").AutoFilter
'xl.Range("A1").Subtotal GroupBy:=2, Function:=2, TotalList:=Array(2)
xl.Columns("A:F").AutoFit
End Sub
Function AttrValue (comp As Object, atrName As String) As String
If comp.Attributes(atrName) Is Nothing Then
  AttrValue = ""
Else
  AttrValue = comp.Attributes(atrName).value
End If
End Function
点评回复

使用道具 举报

 楼主| 发表于 2007-1-18 08:25:29 | 显示全部楼层
PowerLogic中支持写Basic Scripts吗?没有往这方面想,可以告诉具体如何操作?谢谢!
点评回复

使用道具 举报

 楼主| 发表于 2007-1-23 10:32:43 | 显示全部楼层
谢谢,已OK.
点评回复

使用道具 举报

发表于 2007-7-24 17:08:52 | 显示全部楼层
[em01]
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2025-2-25 10:28 , Processed in 0.046578 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表