TA的每日心情 | 开心 2022-11-1 15:51 |
---|
签到天数: 62 天 [LV.6]常住居民II
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢# Q* J+ N$ L# z7 W' c8 y ]: P
{..............................................................................}
( X6 L! a7 s+ H( F6 S m{ Summary Demo how to fetch pins of components. }
_: i+ c4 {$ m7 Z6 A{ }) b. ~! h% B; O5 x7 p6 A: I+ Q: j
{ Copyright (c) 2008 by altium Limited }
& n# F! u/ q$ s% R. p/ A: o# M$ C{..............................................................................}1 `$ M4 g- F0 ` ^9 H. v, I
* ?% b5 h. L4 W' X2 Y, e% c
{..............................................................................}
# q$ ?, a7 c/ l# NProcedure FetchPinsOfComponents_U1;
& T( G' d+ x1 [! ~. EVar
% ~9 e) l0 Q- b# B- c CurrentSch : ISch_Sheet;
& K2 U3 S3 C2 u) u I* D Iterator : ISch_Iterator;
: ^0 ^8 @+ ?$ ~ PIterator : ISch_Iterator;# l3 G( s4 m: K: y0 o2 e8 I
AComponent : ISch_Component;
0 d" Z+ P) H' G, z% G1 d, H5 w6 Y& ^ AnIndex : Integer;
( C7 A( _9 _1 p( \% U9 C5 @( e* }) ~: A0 V6 M
ReportList : TStringList;
u/ u8 J1 q/ H8 A Pin : ISch_Pin;
+ \# k+ N0 Q7 D' w* f, t5 p5 p Document : IServerDocument;- m* D2 X1 ^# }2 C1 w4 `4 h2 C
Begin
, M) S( v1 x! G2 }0 M% n- Y+ ~ // Check if schematic server exists or not./ @6 O3 q3 e8 r) R1 D9 U
If SchServer = Nil Then Exit;
+ q8 o6 [3 g# ]9 H9 R, }$ ~( o) N' @+ S5 X7 T+ a2 X) f6 }' {+ r1 O
// Obtain the current schematic document inteRFace.3 }1 _# R/ K) j+ Z& o$ ~
CurrentSch := SchServer.GetCurrentSchDocument;' c( s& l2 W0 j9 u9 g; A- m
If CurrentSch = Nil Then Exit;
% M J: F& m2 P1 v( g# i4 t- l7 P& Y" d9 a* l, H* ]
// Look for components only( f6 b8 S w: [ s
Iterator := CurrentSch.SchIterator_Create;+ g O1 }& S& A& M* r! ?
Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));* z: M& T4 G5 t% G. _
4 D7 ?" k8 N* u+ @% p3 c ReportList := TStringList.Create;9 t( D0 J4 w( S
Try
( q4 l! L- L7 p" p [ AComponent := Iterator.FirstSchObject;) P6 F$ t: Y& J$ x4 f' _+ h
While AComponent <> Nil Do" o% R, m" v+ W+ m; Q8 n2 b
Begin
1 H7 V* c3 U+ D7 w% L7 s if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....3 Z5 L3 z- V$ F7 |* Q
Begin7 z$ ^( E# {: {1 Z2 T( D
ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);
6 B) k4 K' @6 n3 l ReportList.Add(' Pins');
" _- J' I2 q* `/ D# Q2 l
8 K9 U8 e, T/ d( s8 j: |" X/ k- K Try7 u" h7 A# j; r4 ~
PIterator := AComponent.SchIterator_Create;( _, C( N3 Y g) H
PIterator.AddFilter_ObjectSet(MkSet(ePin));3 t# o# Z3 ?' x5 U
" P1 D5 J6 e5 G ?; F Pin := PIterator.FirstSchObject;
1 I2 l6 U$ T9 n1 U( L! d While Pin <> Nil Do) x! U( ?4 F$ k( T# G
Begin: ^4 ?8 j0 X) k H1 Q S6 E
{ ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }4 c: N% T+ l2 L5 O' y
ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);! m8 ]% c. M r5 L; I* l
Pin := PIterator.NextSchObject;8 S$ j c9 z" T. ]+ u4 |+ a1 w) R4 A
End;4 [/ u( N$ l- i) Q# q3 o
Finally
- r5 I; H# T2 K4 [ AComponent.SchIterator_Destroy(PIterator);
* `; p- v" p7 { End;/ H; L9 P9 d) \
. _9 G7 U- @2 u) S
ReportList.Add('');8 G, E7 u X7 x; v9 U
+ G* r8 m" x& k! z$ s2 R1 r
End;
( G/ d. u2 I$ b# }3 A
0 a( g+ s' V/ P7 H. O! L- C/ J AComponent := Iterator.NextSchObject;- V3 _5 G& b! H$ D
End;0 y0 Q% m" f+ K x1 y
Finally
8 j0 r5 Y3 O I S4 K; l) [ CurrentSch.SchIterator_Destroy(Iterator);. w% f' k" B6 f! L6 T. r& I
End;
9 Q, N( M1 `1 |- V
; Q: c! L) B- Y4 _( }" z7 G ReportList.SaveToFile('d:\PinReportU1.Txt');
- D) _- w; ]# ]* u* c2 w2 T# r ReportList.Free;6 H p# \5 b. S; \. [5 M4 {& m' z
) n9 T* Y/ M, Z# w; X
// Display the report for all components found and their associated pins." W! [; U$ x% F8 }( B! m
Document := Client.OpenDocument('Text','d:\PinReportU1.txt');
3 Z) Y7 B- @$ J" N9 _& S, W( [ If Document <> Nil Then
# }: x0 h. N# s7 I5 G Client.ShowDocument(Document);$ R+ I& g p6 C/ P$ Z
End;* l( i. c5 G9 ^( u- E5 [$ M
{..............................................................................}
+ ~1 `. ^# l2 t7 S
. C6 x( \& R8 K7 v, m{..............................................................................}
8 h9 n6 w9 m+ t p2 yEnd.
8 P- [+ S, `7 ~# r9 p' i0 u2 m* W. L; V1 L
|
|