怎么导出元件的值?
现在有一个 文件要做BOM,怎么才能把元件的值导出来,report 里part list1.2只有封装,basic里17项也整不出来。请知道怎么做的兄弟指教下。谢谢!
file/Report/bill of materials,具体要哪些内容可以到setup里去设置,前提是你的元件的Attributes里已经添加了你要的东东。
我也想知道,请2楼的具体讲讲 好吗?
file/Report/bill of materials.
bill of materials我的没有这一项呀。
简单,将basic script的第17项修改一下就可以了,最好是先另存再做修改,修改的内容如下(这里是在PartDecal后面加上PartValue,大家可以根据自己的情况修改):
先找到这一段:
……
Open filename For Output As #1
' Output Headers
 rint #1, "PartType"; Space(32);
 rint #1, "RefDes"; Space(24);
Print #1, "PartDecal"; Space(32);
 rint #1, "Pins"; Space(6);
 rint #1, "Layer"; Space(26);
 rint #1, "Orient."; Space(24);
 rint #1, "X"; Space(30);
 rint #1, "Y"; Space(29);
 rint #1, "SMD"; Space(7);
 rint #1, "Glued"; Space(0)
' Lock server to speed up process
LockServer
' Go through each component in the design and output values
For Each nextComp In ActiveDocument.Components
 rint #1, nextComp.PartType; Space$(40-Len(nextComp.PartType));
Print #1, nextComp.Name; Space$(30-Len(nextComp.Name));
Print #1, nextComp.Decal; Space$(40-Len(nextComp.Decal));
Print #1, nextComp.Pins.Count; Space$(10-Len(nextComp.Pins.Count));
……
注意到红色的字体,我们现在只要在红色字体后面加上一句就OK了,如下绿色字体:
Open filename For Output As #1
' Output Headers
Print #1, "PartType"; Space(32);
Print #1, "RefDes"; Space(24);
Print #1, "PartDecal"; Space(32);
Print #1, "PartValue"; Space(32);
Print #1, "Pins"; Space(6);
Print #1, "Layer"; Space(26);
Print #1, "Orient."; Space(24);
Print #1, "X"; Space(30);
Print #1, "Y"; Space(29);
Print #1, "SMD"; Space(7);
Print #1, "Glued"; Space(0)
' Lock server to speed up process
LockServer
' Go through each component in the design and output values
For Each nextComp In ActiveDocument.Components
Print #1, nextComp.PartType; Space$(40-Len(nextComp.PartType));
Print #1, nextComp.Name; Space$(30-Len(nextComp.Name));
Print #1, nextComp.Decal; Space$(40-Len(nextComp.Decal));
Print #1, nextComp.Attributes("Value").value; Space$(40-Len(nextComp.Attributes("Value").value));
Print #1, nextComp.Pins.Count; Space$(10-Len(nextComp.Pins.Count));
……
修改后保存运行就可以了。
注意:要保证所有的元件都有Value,否则不能运行,只要有一个元件的Value为空,程序跑到上面长长的绿色那一句会就过不去,中午不睡觉研究了半个小时也没搞定,决定放弃。注意孔的value也不要为空。
LOGIC里面应该更方便一些
看看这个帖子中我的回帖,这个是一年前回的
http://www.pcbbbs.com/viewthread.php?tid=129231&replyID=13682&skin=1
多谢各位兄弟的指点。
