|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢1 y8 v$ W4 Y0 e' i
{..............................................................................}/ x! s) N6 k, M' B8 y" Q1 \# y3 ~
{ Summary Demo how to fetch pins of components. }: E$ {! X1 z% o5 n
{ }
& F/ t x5 H9 e* y6 p) e{ Copyright (c) 2008 by Altium Limited }+ L6 ^- s7 I2 g& X H
{..............................................................................}
0 q0 |# O$ L3 s9 C! o P7 Y c) E5 `6 |. q/ k k
{..............................................................................}; _! \/ t; c8 P4 Z- E+ s
Procedure FetchPinsOfComponents_U1;2 K, T6 w4 r) s, ]
Var' c" B1 _7 V& W0 O- x' c/ D' [9 A) `2 }
CurrentSch : ISch_Sheet;
. T( f* j5 k- \6 `+ c* A5 @; t Iterator : ISch_Iterator;
4 U) v; b7 I3 j, P; d% { PIterator : ISch_Iterator;9 l8 N! M0 Z2 r: t% N
AComponent : ISch_Component;
) I- `$ r( Z2 Z0 |; V* ] AnIndex : Integer;
E/ f# q9 v' A" o6 `* S. J$ ^( |% B6 f3 ^# B
ReportList : TStringList;- c+ A/ q! ^# k
Pin : ISch_Pin;
- i$ s1 u* k1 I$ B& U Document : IServerDocument; h) u9 q" O+ ?6 W, @! x
Begin; _0 J6 k/ M5 }8 L- e
// Check if schematic server exists or not.) y! E8 D* j$ v% f* l; |9 i& F" O
If SchServer = Nil Then Exit;& p$ i3 ^" T m2 U+ a/ ~
. q$ s# l3 E7 g* o0 s
// Obtain the current schematic document interface.9 e" @$ e6 d- A* j L- n
CurrentSch := SchServer.GetCurrentSchDocument;: Q" c4 H& { W
If CurrentSch = Nil Then Exit;# T6 J, x( y8 v0 [
3 d: L+ s) b6 ?5 k+ X // Look for components only- ]4 F: L5 Q- h- ]. W% p6 c
Iterator := CurrentSch.SchIterator_Create;
# a+ t: R# l$ I: w6 z/ Z6 a Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));8 Y& D6 J9 N$ K5 \9 M [! f+ T2 Q
/ a- u# Q& E# F+ x+ |8 D. l/ g$ ]
ReportList := TStringList.Create;
2 @% Q0 r0 ^7 i! ` Try
+ R: d, Z" L& v5 ?7 ` AComponent := Iterator.FirstSchObject;
$ e8 O- G+ C6 p" J While AComponent <> Nil Do+ D2 E/ f# P$ w4 O3 r) b( @3 v( J$ Z
Begin
0 E, Y7 L8 o! p! r if AComponent.Designator.Text = 'U1' Then // change to the designator number you want...... w0 g: b* T; W
Begin0 C1 w3 n& S4 ?' T
ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);
0 H! \' [- `& Q4 q- w! z ReportList.Add(' Pins');
4 L& X- l8 q7 d+ d
7 G& Z4 b. T9 m1 ]( I# e8 |8 C Try) p* I/ }% D( W* c# e. @. `6 f
PIterator := AComponent.SchIterator_Create;1 s7 a. T& g) O* s6 e" h) T. S+ g
PIterator.AddFilter_ObjectSet(MkSet(ePin));& j& R, c( z4 a: T+ d8 g! J! I
/ L+ l2 p6 ?) c$ x1 ] Pin := PIterator.FirstSchObject;, w* s6 h) X! l: _; |
While Pin <> Nil Do6 ?% D7 M! ]! s/ }8 y+ N0 S
Begin
! p8 h( |; K! Y& K { ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
2 }7 i( k1 T$ p( q/ Q ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);2 }% K: C+ _1 \6 H9 `$ g6 [
Pin := PIterator.NextSchObject; _7 b5 Y W$ r' N+ A
End;
7 ?6 [" s: Z4 T% u# D Finally- [" m# ?- F* n! E+ A2 D- r
AComponent.SchIterator_Destroy(PIterator);
. x# `9 f6 ?1 V8 K$ U0 \ End;9 P3 R8 z: R6 e7 Z! C, u( I& ~
- u: W. C0 i% V z7 {+ E. d ReportList.Add('');
$ w: d/ X4 @& V, _5 c; ^7 f1 }! j7 j+ Y" `" [; [
End;* r/ y2 X$ m4 P2 A- |
. T7 c2 X& |/ a8 G9 E1 O* i1 }1 {
AComponent := Iterator.NextSchObject;
$ d% ?2 z5 Y# N$ R End;5 k" e1 z5 \& r2 }% }% `8 b
Finally
) r- c* ~: r; k" h& |7 } CurrentSch.SchIterator_Destroy(Iterator);
2 Q) p/ u7 ?+ Y. Q, T1 |& Z. g7 g) q" E End;1 G/ } y' A& B% c- e4 _3 p
" m# M7 y6 A d0 f! X7 n# |8 D% t
ReportList.SaveToFile('d:\PinReportU1.Txt');4 s/ S' r" ^) s
ReportList.Free;" E5 x+ c( s' M
' D( B+ L6 R/ {1 {1 Q, b
// Display the report for all components found and their associated pins.
5 e1 _; m7 D8 _1 ~9 r2 m) t- h Document := Client.OpenDocument('Text','d:\PinReportU1.txt');
- w4 g9 f# E" k5 h If Document <> Nil Then
6 D( N; P: y* i O" e: p Client.ShowDocument(Document);
' T( h7 l/ L8 e, @% ?End;
5 h+ |5 {9 r6 E5 k9 y" R) @{..............................................................................}* U( c3 m) X0 |/ M0 \
0 I7 [+ A1 h! I* A6 o{..............................................................................}; }- y( W: J( v: N6 J. P) V, d; ?
End.
- a! | O- e7 ?' k7 b2 j/ S3 Q
, {9 I* ~; V- Y* H1 _% q; A |
|