TA的每日心情 | 开心 2022-11-1 15:51 |
---|
签到天数: 62 天 [LV.6]常住居民II
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢3 h" b) G& |" i% e3 U d' N p9 h& M4 B
{..............................................................................}; M% l& X X1 o% I+ T: g8 x
{ Summary Demo how to fetch pins of components. }
& G1 X; V1 a) U1 V2 N5 G& |$ V$ m0 K& I{ }
- `& \& v: h& \{ Copyright (c) 2008 by altium Limited }7 p6 @* n( @0 c1 n( j0 _- ^. g- k3 n
{..............................................................................}
1 ^5 Z# h" q% E: b$ R1 i
* H7 S( a$ Q% @{..............................................................................}+ N' _/ ~9 G B& T! f
Procedure FetchPinsOfComponents_U1;
, z3 {2 Z7 g2 `: pVar: E7 d/ m: J. H( p( Q
CurrentSch : ISch_Sheet;
: l" H, o# D c1 C: `9 [ Iterator : ISch_Iterator;
1 w2 ^2 {( o# V& s5 }6 A2 Y3 `' y PIterator : ISch_Iterator;
4 ?8 j; `" a, t f. O/ S6 x J/ S2 Y; j AComponent : ISch_Component;6 j O- `: n3 e% z. U. V
AnIndex : Integer;
) S/ I% W f: k# l2 N) M# \2 a, X" I
ReportList : TStringList;* e; n1 r% ?% `0 E1 q
Pin : ISch_Pin;7 m/ v6 p) j3 `! I% H$ ]% O3 ]
Document : IServerDocument;/ N8 q; y, [% L: V9 B/ p- ~
Begin
7 f- a# M1 B1 [) W/ @8 X: B // Check if schematic server exists or not.
) @( ~ t8 Q8 m4 u& f+ G If SchServer = Nil Then Exit;
3 r3 A# ~5 W$ N; ]: P" S, d$ p7 O' p M: k8 y
// Obtain the current schematic document inteRFace.! }$ n1 K: u z& u" u' A
CurrentSch := SchServer.GetCurrentSchDocument;4 }8 A" f4 }, y4 Z& p# |, T4 T3 H
If CurrentSch = Nil Then Exit;
0 }# Q. K* K3 s# n- P. F' u. g$ o( c6 ^* }
// Look for components only
' C4 _1 x) } c# Y# X7 i( S Iterator := CurrentSch.SchIterator_Create;4 r/ \# F. W& @0 l! i( Y6 T
Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));
2 e. q/ \% K2 s0 f, x0 J2 ^/ e) J! b* w6 u0 k
ReportList := TStringList.Create;
; n! g& O( {. [9 N Try
, i3 K) d# ^4 i, k& q9 \9 o AComponent := Iterator.FirstSchObject;
# d. r& [' y8 c0 e' K! H While AComponent <> Nil Do
) A$ X" M! a8 [! i4 u O7 }# g Begin
* H2 W1 A. B2 G+ U) F7 `+ \. J if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....
. f& \* l P& W' _* q Begin. C" u* ]* G& {
ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);% I1 J2 B! A* t, Q* n
ReportList.Add(' Pins');& x' C4 S; c; `0 n2 p
: t6 E) k* T @ Try# X q. G# C2 b; j9 J
PIterator := AComponent.SchIterator_Create;! N3 p e R7 l/ f- @' M$ f! t
PIterator.AddFilter_ObjectSet(MkSet(ePin));2 q" t/ B8 I' o- h+ i
7 _% O; c$ M1 A
Pin := PIterator.FirstSchObject;
9 i) @( W5 u& R- E0 e) f: n1 X While Pin <> Nil Do7 L9 w# k- g3 O( \4 l1 W- j% s
Begin
* H' d# F( M- M% z w { ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }% J. P& J( a* C& Y* I8 `: t
ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);" m- L- F, L( `4 a% ^
Pin := PIterator.NextSchObject;
/ _/ ~! A/ K0 o" h End;+ s% d' d: d" E {0 ?. b% E3 {* D( }
Finally
& m6 g; I0 j0 X7 f. h+ c" H AComponent.SchIterator_Destroy(PIterator);$ c0 Q' D# |7 m7 N' J+ h5 m/ t% g
End;* H4 m5 A6 R6 f# J) I' X
@- G; q- [* U7 a0 t ReportList.Add('');) d$ S8 h( B- [( b8 g) m
. e5 w1 ?; ~4 u/ a End;
+ o* K" n) g; ^" A6 |4 R* K7 S
4 P, f/ Z) ^: D3 J9 L `/ y2 \ AComponent := Iterator.NextSchObject;
& l, _. m& T' a* P End;
0 f$ u9 w, I, ^% Y Finally
5 _$ O) a' M# O. V CurrentSch.SchIterator_Destroy(Iterator);
, H6 D7 a& e; t* z End;2 f- b0 x' O2 x& K( f( }& L+ H# z
3 ?9 o3 h# u0 N$ J ReportList.SaveToFile('d:\PinReportU1.Txt');, h1 U2 s; R( p% q/ H+ t! k
ReportList.Free;
3 I' w P) A7 s1 h; H+ ?& Q
4 D7 V9 ^" c2 W1 o // Display the report for all components found and their associated pins.
1 I$ Y( p" g8 i% a$ C2 x# w Document := Client.OpenDocument('Text','d:\PinReportU1.txt');0 x# F. k+ l5 M( f1 s' I j; |
If Document <> Nil Then( c* m( B T0 o! N
Client.ShowDocument(Document);" S6 Y# q/ t/ _. _ p. x1 N
End;# L' u% O; n7 g" `, \; Q
{..............................................................................}
+ f' _ H: j2 B1 ^! J
5 D8 O- p$ c P) X2 m{..............................................................................}# @& }- u( |: n: n F
End.
% o8 D6 G! Y- F- [: R, F( Y! ~/ l1 h
|
|