TA的每日心情 | 开心 2022-11-1 15:51 |
---|
签到天数: 62 天 [LV.6]常住居民II
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢
/ |: S) i5 X9 t- c' t. C `! y& f{..............................................................................}# ^& Z0 D! j+ X. o
{ Summary Demo how to fetch pins of components. }( k( q2 T5 @) I: b2 `
{ }
+ N a2 \! K, \; x{ Copyright (c) 2008 by altium Limited }
4 g$ U7 x" s& G2 t, L{..............................................................................}
. R; X6 D; D: _9 w7 c* K
& J' J1 G' i3 V+ w2 y; E; X* N' x{..............................................................................}& B( c/ x; ?, g4 L$ Y
Procedure FetchPinsOfComponents_U1;
$ ?" j, y/ I+ \2 y) tVar
; ?4 f* u/ l8 G7 Q9 U, N" i CurrentSch : ISch_Sheet;1 I" J" N4 i- h/ [9 |0 L
Iterator : ISch_Iterator;) c$ s( X" f% d6 T8 [% x- r9 ^
PIterator : ISch_Iterator;6 T. \5 g: X t! C$ ]$ Y' q$ w
AComponent : ISch_Component;
( s( _$ s* d5 E! t* _& X( } AnIndex : Integer;5 W2 J0 m7 C4 J- R* N# d. S
# T1 b3 ^/ j( a( e
ReportList : TStringList;5 W9 L5 O1 M6 `5 t. m% _. A f
Pin : ISch_Pin;
0 W4 \* \0 v# M4 B Document : IServerDocument;
& d3 s) b, G7 L+ Y7 {3 UBegin( U6 M2 l, o g( ^; l
// Check if schematic server exists or not.$ ~6 b/ c9 x4 C9 B8 d4 Z
If SchServer = Nil Then Exit;% p5 ~2 T) {( C
8 S4 k: t+ x/ |3 p# z
// Obtain the current schematic document inteRFace.
4 k. F# z& ~! l CurrentSch := SchServer.GetCurrentSchDocument;
: k4 i# u0 [4 a& U7 q6 x7 Z If CurrentSch = Nil Then Exit;
) F0 x9 S) ` V+ x, I
! t1 Y( O3 e& x( g+ U- n // Look for components only
2 W& n4 p3 e0 m* w0 U# I/ @; ^ Iterator := CurrentSch.SchIterator_Create;' K9 U; h4 L+ [2 @
Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));6 O% @0 \4 @4 h( @
) k9 x9 K: V7 G( A% r2 f( ?; D ReportList := TStringList.Create;
7 {1 q# P/ N; d; s* M Try/ e: f( Q* ~) b$ v5 _
AComponent := Iterator.FirstSchObject;
, j j6 F8 U# E, w" d9 h6 a While AComponent <> Nil Do
! }# Q1 b; a, _$ D# W& l7 S( q0 ~ Begin
+ F8 i* `6 K* Y6 r0 ~ if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....4 J) D1 T* e* v/ w- D
Begin" L$ n: x! j6 D3 C% C6 g
ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);% ^1 N! |; r' ^
ReportList.Add(' Pins');$ |/ e" \) P& Q: v) _1 a3 o
9 m4 C: J5 c6 K9 |% k* S0 k Try
; j: d1 z3 Q; b7 k1 F6 L3 R PIterator := AComponent.SchIterator_Create;
) x# E4 k2 R) |1 O) Z( Z; X PIterator.AddFilter_ObjectSet(MkSet(ePin));
: l/ C* k; E% T9 m4 `: n3 y& M
2 K% j7 n1 w% e4 `* V6 Z7 s- z A7 P Pin := PIterator.FirstSchObject;
9 h {8 v' Z: g8 v% P0 V" z While Pin <> Nil Do
4 U$ w, [: U0 B2 ~+ @: p7 S Begin- i& K, m, P/ h9 d' t/ P! ?7 C
{ ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
+ Z+ T9 u/ Z4 y3 s3 z @ ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);$ P% O9 S1 X7 f) b7 R, i- ~
Pin := PIterator.NextSchObject;" B$ I P8 S0 ^
End;
1 k9 \3 @2 C" U4 S& c+ | Finally
B/ f* O1 M/ b AComponent.SchIterator_Destroy(PIterator);
% z. B9 a) b0 @ End;
0 S4 a1 W6 x" @+ J
" Q3 x4 d; ^ o! X) p1 n ReportList.Add('');
: v: g/ f( T- V% s9 P' B8 H
5 M1 N* z9 V! } End;% ~* `0 O1 f8 k) w6 X- E' m
! [' }8 ?4 |. p8 E$ c+ L# z AComponent := Iterator.NextSchObject;
5 ~1 a2 t/ e- N End;0 I" E/ Q* y6 G" U+ o K4 }
Finally
; z# U) J/ m% e" n( b5 i# p8 E0 Y CurrentSch.SchIterator_Destroy(Iterator);
& u0 Z9 Z; R0 Q) E/ Z+ j End;
/ g4 y- }; X, v: r/ }3 I! W e) ?" ^2 a7 }0 |( f* L% y
ReportList.SaveToFile('d:\PinReportU1.Txt');) \7 O' q- q4 A1 x4 P! z4 }
ReportList.Free;3 P6 J" L' U0 S3 M$ S# T
2 m% c+ f9 n& ?# y
// Display the report for all components found and their associated pins. { f X! ?- u, K
Document := Client.OpenDocument('Text','d:\PinReportU1.txt');# W6 [8 _/ p. [( y2 a
If Document <> Nil Then
- T5 C9 z* z( X Client.ShowDocument(Document);
' b n- |, I: VEnd;# r+ Q# s Y5 ?/ ]8 G ~
{..............................................................................}3 G) f @' y% R8 g4 e
+ U, `, d/ g1 g/ m4 m, e; q{..............................................................................}7 K8 k9 @" I, X9 H# x* B4 p
End.) S1 ~! n- _; N2 d+ o5 ~8 {
. h5 N! n# T0 R& w+ m |
|