|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢* p8 N; T* Y! }9 W0 w! X
{..............................................................................}! w5 X+ V @9 c' C! I5 v8 h
{ Summary Demo how to fetch pins of components. }% X: }$ G# }& u* @ A- g/ }
{ }2 f: R0 L* _% I" T* e9 A
{ Copyright (c) 2008 by Altium Limited }
- L* @5 P+ Q6 n' }. K. I. e{..............................................................................}: `; B3 n9 o0 Q3 w3 g
# o% r/ _* H" b. s
{..............................................................................}! E8 V1 A2 n8 W/ _. J A
Procedure FetchPinsOfComponents_U1;
' h$ L: X9 K1 D9 w# B) s, DVar
5 A+ b9 a' y# m) [7 [% n3 n CurrentSch : ISch_Sheet;/ p# t6 ^: U! X0 H0 M; J
Iterator : ISch_Iterator;6 i6 b! F% i: a. G# W- \
PIterator : ISch_Iterator;
0 v8 ^. O, K; G) e5 e \$ F AComponent : ISch_Component;6 |3 q* v3 o8 e( I0 j4 l
AnIndex : Integer;; `3 F/ ^( |" w$ S9 x& L
2 P* q% z5 `8 d0 C, Z ReportList : TStringList;
( W4 Y. Q3 W+ Y+ d( n Pin : ISch_Pin;2 l( A8 p+ h l* z2 T# p
Document : IServerDocument;! l) C+ W, }3 v
Begin
4 \+ _1 r, @0 y2 w" I // Check if schematic server exists or not.8 `( z! K' @; `! h2 K* y! s4 U! A0 r
If SchServer = Nil Then Exit;
# k& L. a( `6 y$ P3 [
, ^* p# F) I- V( X, P8 t! r // Obtain the current schematic document interface.
/ d! Y$ s! J& Z2 l$ ~( L CurrentSch := SchServer.GetCurrentSchDocument;
: |0 j6 @/ X; n' d/ d If CurrentSch = Nil Then Exit;1 A. X, l' u" U& o0 x& q
2 a: r0 j2 q/ u6 k+ e6 S // Look for components only
" K$ i$ o! g9 E0 R Iterator := CurrentSch.SchIterator_Create;
3 w" r4 l8 e# S* @ Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));( M/ Q+ u( E" H
: R7 d4 a# I9 g5 a2 P ReportList := TStringList.Create;' H" q A# W: j1 d, W6 ^; F
Try
8 W, P# G- z6 C: \4 z AComponent := Iterator.FirstSchObject;
+ O5 c. ?1 n! f8 k; C9 t While AComponent <> Nil Do l4 ?' {/ A. H" n
Begin: |; `/ T* p3 R3 J
if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....
9 P2 x" T8 F3 W, r- }9 G Begin9 h/ B* u4 X0 Z, C
ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);
0 [3 e) q" y' g6 G. p ReportList.Add(' Pins');& E9 v* {1 s% }# f- t
6 q. Q) K. D0 s) i1 y
Try
d* ]4 V. d$ K6 v# g2 ? PIterator := AComponent.SchIterator_Create;! B1 _& c- I1 ]( j8 N7 }9 F9 B
PIterator.AddFilter_ObjectSet(MkSet(ePin));
7 D7 f; n, W( }1 K3 C' M' z! R! K$ Q
2 r4 E8 n, r0 ^6 |- R& s Pin := PIterator.FirstSchObject;
( N; i, Y/ L( U/ D; d While Pin <> Nil Do3 r1 _2 h3 e( J L2 ?
Begin8 g1 [ B4 f7 I0 k
{ ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
9 P& a: n. z; E, y ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);
* K! ^ S1 g1 T& j+ v Pin := PIterator.NextSchObject;0 b; d0 t a1 f
End;8 v. W; W. M" `
Finally
# U9 T7 `2 r* N; b D AComponent.SchIterator_Destroy(PIterator);
) c0 ]/ U5 h* H' }9 k/ A7 w End;
. F4 ?( s8 z, _' R3 ~/ s r% T) [) X( z' c; }
ReportList.Add('');
' Y& T, C/ V; A( i7 Y# J3 g* v" p2 H6 x6 r
End;
( W0 e+ P2 [, F- H! t: g
; I3 A O2 V7 g. {: K5 o AComponent := Iterator.NextSchObject;
0 j5 g& {" p1 i% q0 j! O5 d6 V6 c End;# K1 y) m5 g8 q. ]* M" F2 l' N
Finally* n6 R: C) }) |; g7 a v! o/ U9 Q4 P
CurrentSch.SchIterator_Destroy(Iterator);. }2 B7 v( P" R1 i8 ~
End;
3 u* `% F5 g; q: \3 x3 Q7 `
& k$ K; S" y$ {% q4 F' y! E ReportList.SaveToFile('d:\PinReportU1.Txt');
: m% g% h3 Y( `! N3 D8 Z/ `4 s ReportList.Free;
: k; s5 \( ?$ r' T
' J( m$ J; t9 r q // Display the report for all components found and their associated pins.
Y: h; h3 b+ t' I! W* d* y/ h Document := Client.OpenDocument('Text','d:\PinReportU1.txt');; \3 |( Z8 v4 {6 G- H
If Document <> Nil Then
! Z, f+ g* A$ s, [6 b0 Q$ R Client.ShowDocument(Document);
1 ~2 w% X" Z1 k% w& `( yEnd;. z0 k2 b* ]5 j# ^5 |7 ]
{..............................................................................}
8 T6 l0 a4 [* n% V. K4 k$ M" o& y( y9 v" y( k3 M6 ]: F4 ~
{..............................................................................}
+ S* ?4 J0 n: s% iEnd., I& z/ L' j& R7 w' L2 z3 Y8 B
6 ? Q1 R4 P: o3 U% D
|
|