找回密码
 注册会员
更新自动建库工具PCB Footprint Expert 2024.04 Pro / Library Expert 破解版

创建BGA封装PAD脚本,省事!超1000焊盘进

[复制链接]
admin 发表于 2012-9-5 09:48:55 | 显示全部楼层 |阅读模式

本文包含原理图、PCB、源代码、封装库、中英文PDF等资源

您需要 登录 才可以下载或查看,没有账号?注册会员

×
Var
Board : IPCB_Board;
WorkSpace : IWorkSpace;
Procedure PlaceASimplePad(x,y:double,des:string,xSize,ySize:double);
Var
Pad : IPCB_Pad;
Padcache : TPadCache;
Begin
(* Create a Pad object*)
Pad := PCBServer.PCBObjectFactory(ePadObject, eNoDimension, eCreate_Default);
// Location of pad on the PCB document.
Pad.X := MilsToCoord(x);
Pad.Y := MilsToCoord(y);
// set up attributes of pad.
Pad.HoleSize := MilsToCoord(0);
Pad.Name := des;
Pad.Mode := ePadMode_Simple;
// For a simple pad, only need TopShape, TopXSize, TopYSize
Pad.TopShape := eRounded;
Pad.TopXSize := MilsToCoord(xSize);
Pad.TopYSize := MilsToCoord(ySize);
(* Assign the new pad cache to the pad*)
Pad.SetState_Cache := Padcache;
Board.AddPCBObject(Pad);
End;

Procedure PlacePCBObjects;
var
pads:Integer;
des:Array[1..50] of String;
Row:Integer;
Col:Integer;
x,y,xSize,ySize:double;
Begin
des[1] := 'A';
des[2] := 'B';
des[3] := 'C';
des[4] := 'D';
des[5] := 'E';
des[6] := 'F';
des[7] := 'G';
des[8] := 'H';
des[9] := 'J';
des[10] := 'K';
des[11] := 'L';
des[12] := 'M';
des[13] := 'N';
des[14] := 'P';
des[15] := 'R';
des[16] := 'T';
des[17] := 'U';
des[18] := 'V';
des[19] := 'W';
des[20] := 'Y';
des[21] := 'AA';
des[22] := 'AB';
des[23] := 'AC';
des[24] := 'AD';
des[25] := 'AE';
des[26] := 'AF';
des[27] := 'AG';
des[28] := 'AH';
des[29] := 'AJ';
des[30] := 'AK';
des[31] := 'AL';
des[32] := 'AM';
des[33] := 'AN';
des[34] := 'AP';
des[35] := 'AR';
des[36] := 'AT';
des[37] := 'AU';
des[38] := 'AV';
des[39] := 'AW';
des[40] := 'AY';
des[41] := 'BA';
des[42] := 'BB';
des[43] := 'BC';
des[44] := 'BD';
des[45] := 'BE';
des[46] := 'BF';
des[47] := 'BG';
des[48] := 'BH';
des[49] := 'BJ';
des[50] := 'BK';
//以上范围自己修改,数组大小也要做相应的修改



(*create a new pcb document *)
WorkSpace := GetWorkSpace;
If WorkSpace = Nil Then Exit;
Workspace.DM_CreateNewDocument('PCB');
If PCBServer = Nil Then Exit;
Board := PCBServer.GetCurrentPCBBoard;
If Board = Nil then exit;
(* Place new PCB objects*)
x := 33; //行间距 mil
y := 16.5;//列间距 mil
xSize := 12.650; //焊盘大小 mil
ySize := 12.650; //焊盘大小 mil
pads:=1;
For Col:=1 to 50 do //列焊盘数
begin
if(col mod 2) = 1 then
x := 33
else
x := 49.5;
For Row := 1 to 50 do //行焊盘数
begin
if ((Row mod 2) = 1) and ((Col mod 2) = 1) then
begin
PlaceASimplePad(x,y,des[Col] + IntToStr(Row),xSize,ySize);
x := x + 33; //行间距 自行修改 mil
end else
begin
if((Col mod 2) = 0) and ((Row mod 2 )= 0) then
begin
PlaceASimplePad(x,y,des[Col] + IntToStr(Row),xSize,ySize);
x := x + 33; //行间距,自行修改 mil
end;
end;
end;
pads := 1;
y:=y + 16.5; //列间距 mil 自行修改
end;
(* Refresh PCB workspace *)
ResetParameters;
AddStringParameter('Action', 'All');
RunProcess('PCB:Zoom');
End;
[/hide]
[此贴子已经被作者于2009-2-12 12:07:00编辑过]
*滑块验证:
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

QQ|手机版|MCU资讯论坛 ( 京ICP备18035221号-2 )|网站地图

GMT+8, 2024-11-23 11:28 , Processed in 0.068131 second(s), 11 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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