TA的每日心情 | 开心 2022-11-1 15:51 |
---|
签到天数: 62 天 [LV.6]常住居民II
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢; m9 ~/ [2 e ?, |: y! u
{..............................................................................}1 g+ \" Z2 a" I! y
{ Summary Demo how to fetch pins of components. }+ w3 A1 s. b# B v
{ }
4 }% Y9 M- I' t9 L{ Copyright (c) 2008 by altium Limited }
2 D! D' F/ a, {{..............................................................................}
+ B% r8 ]1 h. x/ r
4 X; ^2 M& ?, z6 _{..............................................................................}$ h h k) c/ I1 M' N% g6 e& L
Procedure FetchPinsOfComponents_U1;0 o8 k. a( F' X0 ~& v. [* e( ~
Var3 g+ s2 e( T T$ C/ j
CurrentSch : ISch_Sheet;% t c5 h, Z8 m& O- D6 ^* S9 g
Iterator : ISch_Iterator;
# i" R5 E D9 i& U1 G- _, g PIterator : ISch_Iterator;2 H. J$ N/ u' P. {
AComponent : ISch_Component;5 K( b6 P2 f! x7 s% u9 s8 E
AnIndex : Integer;
# e8 L) j! c$ N+ |8 z! A% P% T0 A* Q, @5 ]
ReportList : TStringList;
- q4 ]' P0 P6 P, d) }$ `1 { Pin : ISch_Pin;2 \" c( z' \2 J. R' }& t* ~1 _% z7 _
Document : IServerDocument;
6 Y, P0 ^& w/ {( b6 ~' J0 PBegin% U8 H( Q2 _ n/ Z7 s
// Check if schematic server exists or not.8 P% \/ a( N. o. E; M9 I4 g
If SchServer = Nil Then Exit;' x* H8 G. f, U% h
8 ]" h8 ~, d3 |! o
// Obtain the current schematic document inteRFace.
: q; S( x! ]9 ?0 u CurrentSch := SchServer.GetCurrentSchDocument;& S7 i4 n1 g) U/ R$ B( Q
If CurrentSch = Nil Then Exit;
/ o( {- E* O" b% P. p' M8 F. a( b- Q! _( W
// Look for components only
- o0 F6 {# ?, E Iterator := CurrentSch.SchIterator_Create;
; W+ U* z) c) W/ ]: O Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));( `' e1 `# Z$ }4 o& y
0 z- F# G9 h- {
ReportList := TStringList.Create;
2 n ?* B3 y: f Try4 Q; F* I4 m+ G0 U% J, ?
AComponent := Iterator.FirstSchObject;
. u" W% f; |/ U( D7 D) [3 C K While AComponent <> Nil Do
4 Q' B* ^* k& `' V* B8 T( b Begin
2 K6 `6 a9 ]1 |0 W1 t* [2 x if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....
4 t$ F! X0 ^% K7 ~ Begin
+ U- o( E) E3 O" L! } w, P ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);
0 \& x9 s/ V' y ReportList.Add(' Pins');
& E; y( j! h7 a9 `+ d
$ w( i* T3 ^5 q Try
' X: v* k0 q2 V7 C- U1 ^ PIterator := AComponent.SchIterator_Create;
- b' a! U+ F6 c PIterator.AddFilter_ObjectSet(MkSet(ePin)); ]0 t, D' ?: a2 G3 Q
9 z0 s9 V8 [! q, W( y7 g( ] Pin := PIterator.FirstSchObject;; Z, H& j! o6 m d# s
While Pin <> Nil Do0 ]0 T. l/ K: Q I/ m# J2 ?5 Y3 Q1 E
Begin
+ @) Y2 b) ?8 E7 \- r; L { ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
) m$ k# Q* N- V ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);8 U. R1 W3 G$ a& `* h7 I
Pin := PIterator.NextSchObject;
7 {& |& S# M4 j j: [ End;
( F5 k; |0 @. ~# C3 A; U Finally. L2 ^* U6 b$ _! |2 ~, s
AComponent.SchIterator_Destroy(PIterator);) }, S5 |1 |% S$ j
End;* l0 ^ I/ _' M1 K
, ]$ N9 u( `( u b ReportList.Add('');
- H8 ^* y9 {: f X* C
) b9 P4 j0 ~) p. M1 F/ W End;
3 T6 N( E% ] f/ h& L3 C! R Q3 Y0 q2 u1 J& u/ `! o. N& j" P
AComponent := Iterator.NextSchObject;
z2 R0 E: i0 s1 i! o End; Y7 u& P, V+ U! q3 x! Y
Finally; L' o: b) L" W# o& ]
CurrentSch.SchIterator_Destroy(Iterator);: a/ M: c# k* ^+ Q
End;
9 Q3 R( w5 A! P$ O
% Q+ G" e' n. k# U: O ReportList.SaveToFile('d:\PinReportU1.Txt');
6 S' |0 k' P4 g! n$ U ReportList.Free;; G4 w, P$ E, B" ?4 S' Y
5 e- S3 s- I* l5 ?/ }- k$ e- o7 s
// Display the report for all components found and their associated pins.
. Z6 I3 t* U+ ]; X) G Document := Client.OpenDocument('Text','d:\PinReportU1.txt');
" l, i4 L0 |- W. x: ^ If Document <> Nil Then
6 p7 g ?8 z/ S/ ]. l$ }6 F. {3 s Client.ShowDocument(Document);% J ?4 N% g; V5 M3 j
End;2 ^, e8 n. ^7 B/ q5 `
{..............................................................................}
, N- S$ u% q- D- o* y* z D. O* Z) k2 R( x& R5 r
{..............................................................................}
s' D& a& P8 u; n' P. _End.; i$ z& r8 X9 b% b3 V
: U2 }/ [9 O H" a" S; Z) v |
|