|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢
6 k$ J; O, B' U( x# F8 Y{..............................................................................}& I0 _) Z# d& ? _/ ^9 k
{ Summary Demo how to fetch pins of components. }3 U. I, D v7 q
{ }' t! p) a7 G. I6 F$ {
{ Copyright (c) 2008 by Altium Limited }* c5 K) _; V/ p9 }7 P$ A. L
{..............................................................................}
( r6 W5 y9 ]4 j" I' F; q6 S' m5 E
1 F$ g. G9 u9 C! ?{..............................................................................}. c9 h) X. g2 r4 b- M% R( q ?4 @
Procedure FetchPinsOfComponents_U1;
0 V& s @7 p# v# m& A$ tVar* V" u% d i1 h' m1 ^1 A4 V
CurrentSch : ISch_Sheet;
" y5 f f* ^- n1 x8 T4 Y, M# d) M Iterator : ISch_Iterator;5 i+ Q3 N' @8 F- _
PIterator : ISch_Iterator;4 T- r0 }/ x4 e! L, K$ ~
AComponent : ISch_Component;
! Z- \! ]& F+ a* Q$ i AnIndex : Integer;
( ~. Q2 [/ b2 z: p5 h) r# [: V1 V5 P/ f8 j: j
ReportList : TStringList;$ @+ c) z3 d! a# x& q
Pin : ISch_Pin;- p3 s4 y( j9 G: d
Document : IServerDocument;$ h1 Q# p8 Y3 m- s4 Y
Begin4 Q* I" m% ]9 z/ Z8 u! O( l6 x3 a
// Check if schematic server exists or not.
2 y# n2 ?2 ?( S' O If SchServer = Nil Then Exit;7 m1 h; k6 |. o4 C; V, M
9 }4 t+ z8 i, B // Obtain the current schematic document interface.: c6 P% o& M7 {2 C
CurrentSch := SchServer.GetCurrentSchDocument;
+ h+ {/ N0 t/ Z) O# t& j) _/ Z+ o If CurrentSch = Nil Then Exit;/ s) ~- r \% v: N7 y; a i
1 B" E7 |' {% L8 B5 d, L) w3 F // Look for components only/ B4 L& ]. r! u1 ?
Iterator := CurrentSch.SchIterator_Create;
8 b. u! X0 D- w {6 r7 C Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));
, C% I6 ]1 h$ z* r( G. w" O8 Y( A/ ]6 ?- s, @" y. t+ {) `+ R
ReportList := TStringList.Create;
# z* C i" j. | Try1 D) F. t( u9 Z5 V/ ? l1 |1 W
AComponent := Iterator.FirstSchObject;3 W2 z+ r, `6 m
While AComponent <> Nil Do
9 f3 n- X( ]0 D+ X7 n Begin
) w! }6 x' `; [- }+ q if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....
( r9 f$ L/ v4 l9 y8 j Begin
. G4 h) ^% x, |# w7 p3 b+ d7 _8 X% n ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);
) C" H V: _: D* W2 B ReportList.Add(' Pins');" G9 H2 B( `$ ~2 R) A* M
1 x; G6 ]; B9 H* R1 e
Try, h, j! ^# K3 X+ K |
PIterator := AComponent.SchIterator_Create;5 z$ P( c7 F/ D/ \
PIterator.AddFilter_ObjectSet(MkSet(ePin));
0 k* p( ^, j* e) L. K2 K0 q1 [$ i' d
Pin := PIterator.FirstSchObject;8 J, V0 E _% g3 Q! ]1 r3 `9 C& ~
While Pin <> Nil Do
9 h) P. E8 R* [1 j! K8 [; D* W Begin% }+ i ^, B; z$ D
{ ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
) Y8 M, Z! |" }( H9 w' ] ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);$ J5 U9 J- ]1 M( M
Pin := PIterator.NextSchObject;2 W7 j6 s, U. i
End;
% V9 X& z/ x5 j& z& W! \ Finally: I/ A1 f/ a9 Z' S! b; i& D
AComponent.SchIterator_Destroy(PIterator);
$ E' J' \4 A6 U& z0 x0 D- ` End;' x! E5 O2 _# m o2 ?
6 i- a8 P% ?0 |9 K; q
ReportList.Add('');3 d) |: Y" l7 b# M) L, k
% ^/ q: T# W' S# U2 }
End;
) O' u" F( P. V
' e$ X& ^% S1 {/ ^: S AComponent := Iterator.NextSchObject;) o5 _! Q; B. Z6 S
End;
. G6 r5 j% B; | Finally
7 J" C$ T) ` F8 Y0 D; T CurrentSch.SchIterator_Destroy(Iterator);
* r. D. @+ z( l% \% I End;
: y! K8 N+ }, U) I" s( s) I6 p2 [1 V* h$ S% n
ReportList.SaveToFile('d:\PinReportU1.Txt');
+ x* M$ _# F. ?# } ReportList.Free;
5 @7 n2 s( V9 @( J' b [- B# ?% h% ^ {9 O: t
// Display the report for all components found and their associated pins.
( ?, K0 ~" K6 C7 h3 P Document := Client.OpenDocument('Text','d:\PinReportU1.txt');8 d" V1 D' v9 t" _5 A" i
If Document <> Nil Then, o6 g: N0 f4 a( n" Y
Client.ShowDocument(Document);
. x" S# T# Y7 v& v$ ]End;6 I& b2 J( H5 y* G* z
{..............................................................................}
- H3 h% G" \$ t B! \ A
5 O: h. D$ e, x, q, n{..............................................................................}
* { d# j- h3 H+ d5 v0 O% kEnd.' @* j# ~& S: H* C$ Z0 g: Z4 P
! Z) d* z1 H/ }. Z2 ~ |
|