|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢4 V6 w' W" A5 s9 p: t
{..............................................................................}0 e0 y5 O9 _- E6 b
{ Summary Demo how to fetch pins of components. }
1 ^2 K" e2 v0 T{ }
+ M% y: |, ~+ X0 e2 S j{ Copyright (c) 2008 by Altium Limited }
' C- A# G& p# q{..............................................................................}
+ ^6 |$ K$ l! X8 s
6 `% g, g$ m9 S1 |{..............................................................................}- }) O1 B; }5 G z8 F+ m
Procedure FetchPinsOfComponents_U1;! F1 O3 ^9 t! y: H/ g
Var
( Y% V8 D* ^9 f/ U& ` CurrentSch : ISch_Sheet;) D' x% t; |5 B8 B- Y% h- e; A
Iterator : ISch_Iterator;* s3 }7 l9 ^' D& r6 i
PIterator : ISch_Iterator;
3 W# G2 H* J( O' r6 @* D AComponent : ISch_Component;) b8 E) D% v1 U4 j
AnIndex : Integer;
( N/ R- @6 m) s- d! g9 L2 s* \6 ?0 c! b8 u
ReportList : TStringList;/ z9 F: u' o9 w* Z: ^8 U
Pin : ISch_Pin;" ^. o) r8 c4 n$ S
Document : IServerDocument;
8 B, E0 T$ {/ B4 [5 n( uBegin u3 r+ B0 i: q! }/ q2 C; ^
// Check if schematic server exists or not.
9 p3 H2 S9 Z! m7 q If SchServer = Nil Then Exit;3 j( d6 z5 T A7 G* r
* Z8 ^# q: R& N; M" v
// Obtain the current schematic document interface.( j. d4 l$ S& T; m/ f' i- T4 O
CurrentSch := SchServer.GetCurrentSchDocument;
$ ?8 H Y$ i- Q; g1 b0 l If CurrentSch = Nil Then Exit;
8 [+ u, [1 Q1 M8 ^- b6 I7 s) p5 C9 T' @, e
// Look for components only
1 A4 { k/ R* y$ }) b Iterator := CurrentSch.SchIterator_Create;
& P5 O* @* O! a- i Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));3 w! ?8 f0 _3 \ m
6 A# l4 d- j! i" M8 w! q' f
ReportList := TStringList.Create;- I a1 O3 J' ]- t) U; b
Try
( ]. `% J. Z* q$ {8 d4 y AComponent := Iterator.FirstSchObject;0 i- [7 R' |* v- e! H! f% X
While AComponent <> Nil Do
: h) v d8 I+ C9 \8 ]* {4 G) J Begin" |) T- A3 e4 o- r4 {1 j
if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....
3 l- r s2 E6 B/ }# P Begin2 M' A/ E( Z, w0 ?4 x
ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);8 ]7 k! V2 n+ N3 s9 B4 h S
ReportList.Add(' Pins');
4 V8 D6 T6 O1 ~; w$ X
- v3 \% f* P! F, r Try9 Z! A# ?- r! E' G
PIterator := AComponent.SchIterator_Create;
& A7 Q# t. j1 p0 V* l0 [6 i6 Z PIterator.AddFilter_ObjectSet(MkSet(ePin));
! }# J7 i/ J: N" P2 H& S- P+ M- {% w
Pin := PIterator.FirstSchObject;5 {4 L6 a0 |/ W) o$ G
While Pin <> Nil Do
- g) {" f; c8 E+ X7 {3 i# ~ Begin8 Q& k& U+ w) y' N7 V
{ ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
. v$ [$ X4 v4 E M ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);$ k, ^5 h7 D2 n- `; w% a
Pin := PIterator.NextSchObject;5 V2 J' _/ V3 [
End;5 R9 u9 o3 B% W0 m
Finally
$ i& Q( w: S1 F9 F AComponent.SchIterator_Destroy(PIterator);1 y' J+ P. ^( N6 c5 q
End;( y" u5 y5 [, G9 N' }
1 J; X0 o, g& h
ReportList.Add('');
2 ^7 y7 Z. {7 e' ?5 z
) @4 N. X9 N; }- F End;
0 e' C5 q' n. v% l6 S. B9 V
% @- R# @3 O. v AComponent := Iterator.NextSchObject;
& _9 a8 N" h( I* H End;: P; c9 f; V( a
Finally
- }2 [+ R. j2 V: ] CurrentSch.SchIterator_Destroy(Iterator);
1 r/ t f* J# Q+ B7 { s End;
5 H/ s7 @& n+ v& i; F% _% b6 p
6 t6 n: D* N2 x) c8 a. h6 N ReportList.SaveToFile('d:\PinReportU1.Txt');# S+ m8 N$ o1 | R9 p6 P [! B
ReportList.Free;6 c/ v7 e8 j& _4 [3 N
0 {1 y+ Q$ }( e y) F' o- \/ r // Display the report for all components found and their associated pins." x+ m3 @3 R; d& k
Document := Client.OpenDocument('Text','d:\PinReportU1.txt');
; L# e0 u) U! B2 W If Document <> Nil Then2 [- x5 ]2 x, N- K+ x: l/ T7 C" h0 ^
Client.ShowDocument(Document);
2 I8 \ o* K( N( q4 ~6 [6 eEnd;
. G6 z% _9 Z8 ?" s" ~' o{..............................................................................}
, @, m$ g# n0 R$ s# N/ B% d& g6 r/ w% c+ e7 X- w" |4 _1 |
{..............................................................................}
2 G" R K& S# v" s0 A! ~3 ?End.9 r( a1 S. a7 r1 o
( n5 c) q' P+ t0 H
|
|