• 易迪拓培训,专注于微波、射频、天线设计工程师的培养
首页 > 电子设计 > PCB设计 > PADS设计问答 > 求助POWERPCB导坐标

求助POWERPCB导坐标

录入:edatop.com    点击:
我这样导出的坐标:tools-->basic scripting--->basic scripts--->17 part list report样子是:PartTypeRefDesPart Name #1PartDecalPins LayerOrient.XY15040135BD1SOT-233Top085608400TRUE我想再加如两行,比如说厂家,型号,需要修改程式. 17 part list report/editPrint #1, "PartType";Space(22);
 rint #1, "RefDes";Space(24);
 rint #1, "Part Name #1";Space(24);
 rint #1, "PartDecal";Space(22);.................谁会啊?

FILE>CAM PLUS

D614JNZ9.rar
你要的是如下的形式吗?下载文件到你的硬盘并解压,在执行17 part list report的位置画面,选load files按钮调入test.bas文件,执行。好了出来了没?修改文件相当困难。Part TypeRefDes ARTDecal insLayer NameOrient. osition X osition YSMDGluedValueVENDOR
C0603 C1 C0603 2 Top 180 65.62 0.25 Yes No 104 huifeng
C0603 C100 C0603 2 Top180 40.68 -103.78 Yes No 104 huifeng

楼上的给出了一个文件,我也大概给一个吧,很容易的,用connect的库里面的元件测试的,这里的元件带有制造商和描述信息,如图:

我是直接在原来的文件上改的,找到output header这一段,先修改表头,增加如红色字体的部份,双引号部份的内容可以自己写,绿色字体为注释:" Output Headers
 rint #1, "PartType";Space(32);
 rint #1, "RefDes";Space(24);
 rint #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(7);
Print #1, "Manufacturer";Space(15); '在表头加入“厂家”
Print #1, "Description";Space(10); '在表头加入“描述”
Print #1 '换到下一行再修改输出数据的部份,增加如红色的两行,注意引号里的蓝色字体,你可以根据你的元件属性名称做修改,但是,你必须确保你当前打开的文档里所有的元件都含有这个属性,否则就会出错' 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.Pins.Count;Space$(10-Len(nextComp.Pins.Count));
Print #1, ActiveDocument.LayerName(nextComp.layer);Space$(30-Len(ActiveDocument.LayerName(nextComp.layer)));
Print #1, nextComp.Orientation;Space$(30-Len(nextComp.Orientation));
Print #1, nextComp.PositionX;Space$(30-Len(nextComp.PositionX));
Print #1, nextComp.PositionY;Space$(30-Len(nextComp.PositionY));
Print #1, nextComp.IsSMD;Space$(10-Len(nextComp.IsSMD));
Print #1, nextComp.Glued;Space$(10-Len(nextComp.Glued));
Print #1, nextComp.Attributes("Manufacturer #1").value;Space$(10-Len(nextComp.Attributes("Manufacturer #1").value)); '输出厂商Manufacturer #1的值
Print #1, nextComp.Attributes("Description").value; Space$(30); '输出描述Description的值
Print #1
Next nextComp细节方面没有去处理,如果有问题可以PM我

谢谢,试试先

3楼的不错,但是我库里都做好了,是Manufacturer #1和Part Name #1,能不能帮我改一下.4楼的这行报错 rint #1, nextComp.Attributes("Manufacturer #1").value; Space$(10-Len(nextComp.Attributes("Manufacturer #1").value));

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, "Manufacturer #1")
cell.Item(row, 4) = Comp.Decal
cell.Item(row, 5) = Comp.Pins.Count
cell.Item(row, 6) = ActiveDocument.LayerName(Comp.layer)
cell.Item(row, 7) = Comp.Orientation
cell.Item(row, 8) = Comp.PositionX
cell.Item(row, 9) = Comp.PositionY
cell.Item(row, 10)= Comp.IsSMD
row = row + 1
Next
On Error GoTo 0
xl.Columns("A:J").NumberFormat = "@"
xl.Range("A1:J1") = Array("RefDes","Part Type","Manufacturer #1","Decal","Pins","Layer","orientation","X","Y","SMD")
xl.Range("A1:J1").Font.Bold = True
xl.Range("A1:J1").AutoFilter
'xl.Range("A1").Subtotal GroupBy:=2, Function:=2, TotalList:=Array(2)
xl.Columns("A:J").AutoFit
End SubFunction 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

自己看着改吧 很简单的

Space$(10-Len(nextComp.Attributes("Manufacturer #1").value));改成Space$(30);试试

试了一下7楼的程序,感觉不错,帮楼主改了一下: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) = Comp.Decal
cell.Item(row, 4) = Comp.Pins.Count
cell.Item(row, 5) = ActiveDocument.LayerName(Comp.layer)
cell.Item(row, 6) = Comp.Orientation
cell.Item(row, 7) = Comp.PositionX
cell.Item(row, 8) = Comp.PositionY
cell.Item(row, 9)= Comp.IsSMD
cell.Item(row, 10) = AttrValue(comp, "Manufacturer #1")
cell.Item(row, 11) = AttrValue(comp, "Part Name #1")
row = row + 1
Next
On Error GoTo 0
xl.Columns("A:K").NumberFormat = "@"
xl.Range("A1:K1") = Array("RefDes","Part Type","Decal","Pins","Layer","orientation","X","Y","SMD","Manufacturer #1","Part Name #1")
xl.Range("A1:K1").Font.Bold = True
xl.Range("A1:K1").AutoFilter
'xl.Range("A1").Subtotal GroupBy:=2, Function:=2, TotalList:=Array(2)
xl.Columns("A:K").AutoFit
End SubFunction 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

射频工程师养成培训教程套装,助您快速成为一名优秀射频工程师...

天线设计工程师培训课程套装,资深专家授课,让天线设计不再难...

上一篇:怪事.第一层走线不能转弯?
下一篇:已经做好的封装,怎样把原点放在封装的中心呀

射频和天线工程师培训课程详情>>

  网站地图