久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 9770|回復: 9
收起左側

針對PADS Layout把非中心對稱封裝的元件坐標導出所修改的Basic Script

[復制鏈接]
ID:90228 發表于 2015-9-16 01:49 | 顯示全部樓層 |閱讀模式
有時候,做元件封裝的時候,做得不是按中心設置為原點(不提倡這種做法),所以制成之后導出來的坐標圖和直接提供給貼片廠的要求相差比較大。比如,以元件的某一個pin 腳作為元件的原點,明顯就有問題,直接修改封裝的話,PCB又的重新調整。

所以想到一個方法:把每個元件所有的管腳的X坐標和Y坐標分別求平均值,
就為元件的中心。


對于大部分元件應該都是完全正確的。

但也有小部分可能稍微有點偏差,比如三極管、管腳間距不完全相等的繼電器,當然這部分是很少很少的部分,而且也偏差不大。

貼片廠貼片都會檢查一下,特別是不規則的封裝,
也無法認定中心應該設置在哪。

不要偏差太大,即可以稍微調整。


把以下代碼另存為*.bas文件,然后在PADS Layout中導入。

導入方法:tools——)Basic Script——)Basic Script——)Load file,把保存的.bas文件導入即可。

然后點擊run,方法和運行原來就有的我文件一樣。

如果 不會操作的 下載 !





Sub Main
' Open temporarly text file
Randomize
filename = DefaultFilePath & "\tmp"  & CInt(Rnd()*10000) & ".xls"
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, "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

   Dim centerX  As Single
   Dim centerY  As Single
   Dim cout  As Integer
   centerX = 0.0
   centerY = 0.0
   cout = 0
   
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));

For Each nextCompPin In nextComp.Pins
centerX = centerX+nextCompPin.PositionX
centerY = centerY+nextCompPin.PositionY
Next nextCompPin
centerPositionX = Format$(centerX/(nextComp.Pins.Count), "#.00")
centerPositionY = Format$(centerY/(nextComp.Pins.Count), "#.00")

Print #1, centerPositionX;      Space$(30-Len(nextComp.PositionX));
Print #1, centerPositionY;      Space$(30-Len(nextComp.PositionY));
Print #1, nextComp.IsSMD; Space$(10-Len(nextComp.IsSMD));
Print #1, nextComp.Glued; Space$(10-Len(nextComp.Glued))
Next nextComp

' Unlock the server
UnlockServer

' Close the text file
Close #1

' Start Excel and loads the text file
On Error GoTo noExcel
Dim excelApp As Object
Set excelApp = CreateObject("Excel.Application")
On Error GoTo 0
excelApp.Visible = True
excelApp.Workbooks.OpenText FileName:= filename
excelApp.Rows("1:1").Select
With excelApp.Selection
.Font.Bold = True
.Font.Italic = True
End With
excelApp.Range("A1").Select
Set excelApp = Nothing
End

noExcel:
' Display the text file
Shell "Notepad " & filename, 3

End Sub


part_list_in_center.rar

1.12 KB, 下載次數: 32, 下載積分: 黑幣 -5

回復

使用道具 舉報

ID:332724 發表于 2018-5-18 09:18 | 顯示全部樓層
謝謝
回復

使用道具 舉報

ID:354148 發表于 2018-6-19 14:26 | 顯示全部樓層
此算法可能有問題,比如SOT23封裝
回復

使用道具 舉報

ID:360421 發表于 2018-6-27 17:04 | 顯示全部樓層
666,厲害,我們只能做伸手黨了,謝謝
回復

使用道具 舉報

ID:360421 發表于 2018-6-27 17:05 | 顯示全部樓層
非常謝謝
回復

使用道具 舉報

ID:135713 發表于 2018-6-28 18:46 來自觸屏版 | 顯示全部樓層
支持分享
回復

使用道具 舉報

ID:384710 發表于 2018-8-9 17:23 | 顯示全部樓層
正在學習PADS ...謝謝
回復

使用道具 舉報

ID:360421 發表于 2018-8-25 11:06 | 顯示全部樓層
謝謝了
回復

使用道具 舉報

ID:809368 發表于 2020-7-29 20:18 | 顯示全部樓層
謝謝,對我很有用,非常感謝!
回復

使用道具 舉報

ID:250544 發表于 2020-8-2 17:25 | 顯示全部樓層
怎么學習的腳本編程,推薦一下
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 成人在线一区二区三区 | 四虎影院在线观看免费视频 | 国产日韩欧美一区 | 国产98色在线 | 日韩 | 欧美日韩高清免费 | 中文字幕一区二区三区四区五区 | 天天操夜夜看 | 欧美不卡视频一区发布 | 成人国产一区二区三区精品麻豆 | 91精品欧美久久久久久久 | 91精品一区二区三区久久久久 | 中文字幕免费在线 | 欧美激情精品久久久久久 | 91中文字幕在线 | 婷婷久久综合 | 国产亚洲区| 91在线看| 亚洲精品无 | 国产成人麻豆免费观看 | 国产激情视频在线观看 | 色噜噜色综合 | 国产激情91久久精品导航 | 精品成人69xx.xyz | 成人午夜免费在线视频 | 免费三级网站 | 人人操日日干 | 国产日韩精品视频 | 亚洲a网| av一级久久 | 性一区 | 操操操操操 | 日本韩国电影免费观看 | 国产精品中文字幕在线 | 99热播精品| 国产一级淫片免费视频 | 欧洲性生活视频 | 91p在线观看 | 国产精品毛片在线 | 精品国产欧美一区二区 | 一区在线视频 | 国产高清视频一区二区 |