|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢' v0 ] o0 e y8 o+ S
{..............................................................................}
" P, h2 {' h. O/ N{ Summary Demo how to fetch pins of components. }
% a0 k3 `, d' ~ N g{ }
$ B4 E! G0 {. j: h: r{ Copyright (c) 2008 by Altium Limited }
/ i& T W5 n4 b# G) u1 b{..............................................................................}
: N' \8 w8 z# q! v9 h$ r* Y6 r/ p4 |% O6 F
{..............................................................................}% n* N8 W5 c6 [9 A& `9 L
Procedure FetchPinsOfComponents_U1;# H4 b3 \/ V9 Q/ ]) A) j
Var
4 \' K1 J& F y6 r4 l" Z( u1 N CurrentSch : ISch_Sheet;
* b4 ]0 c+ C" q f Iterator : ISch_Iterator;* b% I+ S" Z! y% S1 [0 E" r e5 f
PIterator : ISch_Iterator;. D0 P: f8 P% [; j0 _4 g: _6 x A
AComponent : ISch_Component;" w5 M( R7 Y0 A' C' d
AnIndex : Integer;
& h% }& e. u* b2 @" w6 H7 v/ ?9 \+ I% X1 ~. g+ J& Y
ReportList : TStringList;
. F& G4 F0 |: ]' I3 Q" Z/ T& s Pin : ISch_Pin;
# e0 n* ]" z; k2 V* C5 Q: y Document : IServerDocument;
5 Q$ m' ]* {0 Y3 a7 [" N8 X ]Begin" g0 c; ` t) O g
// Check if schematic server exists or not.) n, _' k3 h5 P5 T& ]+ Y
If SchServer = Nil Then Exit;8 J! m3 l% U+ O5 w4 H9 s/ C
+ G. M5 Y [7 _3 Q- ?2 Z% x // Obtain the current schematic document interface. X, {% j0 P: d. |0 H6 ^" i
CurrentSch := SchServer.GetCurrentSchDocument;
: U4 R7 f$ {6 Y5 y7 p2 Q$ w If CurrentSch = Nil Then Exit;
/ N$ j1 ? H8 Z/ ]
; x" a3 n! ]7 x- z6 ^" P( b; ? // Look for components only% K' c6 `& g6 W% c) F+ ?& n. U
Iterator := CurrentSch.SchIterator_Create;/ \0 w1 P. ~) S& k. n- F
Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));$ t+ g# G5 a+ y# d2 F4 W
* I2 @" o* _4 C2 ~5 m ReportList := TStringList.Create;
: g; B! q7 C# H; k& s Try
- D9 x. v1 }. C! F AComponent := Iterator.FirstSchObject;
; V, L& j1 U; J3 w While AComponent <> Nil Do
! v o& ]) N% S2 I1 ] Begin7 F" H4 t: P( O
if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....
1 b" u1 z2 v8 s Begin
4 |) D1 W* M0 z2 w4 s J ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);
( x0 f6 M$ I8 ~ @ ReportList.Add(' Pins');
# Y4 R8 f6 _. v
! t/ l; E5 e/ q2 b6 p, Y/ x Try, k8 j: T: @% e- [8 o
PIterator := AComponent.SchIterator_Create;- Z8 e6 L, B) G% H4 I" k
PIterator.AddFilter_ObjectSet(MkSet(ePin));
+ T3 }" G2 m: x) J. I0 i9 Y; O9 T9 p1 d/ r8 U( a# N
Pin := PIterator.FirstSchObject;. Z1 @% Q! B! W y, F: F
While Pin <> Nil Do
1 E3 l2 T+ y: Q& y8 k G Begin
5 P& s* i8 o7 l5 B: a { ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
, j7 b2 b& P' \ ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);; \2 `9 T3 l* z9 D1 A# U
Pin := PIterator.NextSchObject;
6 v, u7 `1 T& b* n End;
3 A1 o' w- g. t% ` Finally
, u) E- h8 C% B0 M AComponent.SchIterator_Destroy(PIterator);4 T. l b( @# E! J: l
End;6 N4 g% m7 ~1 f/ a
1 i, [( v9 K6 P5 W ReportList.Add('');# k" s) H& i: N- a
; b3 K" k6 p" p; Z0 s0 F0 X! V
End;' j9 J8 X! J" [. i0 B1 R; R
# }0 g! e: W0 R C
AComponent := Iterator.NextSchObject;
, I7 Z6 l* R+ ]1 _6 H3 _ End;
) s. v1 ^3 B5 R$ c Finally
H4 x/ m$ J4 F. z; J CurrentSch.SchIterator_Destroy(Iterator);) E+ h/ R; ^" n8 h4 ?
End;% @2 q( W' g- J) U* A
. M3 h Y, _) ^ ReportList.SaveToFile('d:\PinReportU1.Txt');, D) y* g( [. J1 M# i/ f$ r# V
ReportList.Free;
0 Z) K( U0 V% I- p+ T) [4 G5 e- O9 E6 |# @( Q+ V' k- Z# F
// Display the report for all components found and their associated pins.- ?7 \! A% v, D) X3 m
Document := Client.OpenDocument('Text','d:\PinReportU1.txt');% e; k# a6 y# B8 q. x( G* o- ~% h4 h
If Document <> Nil Then' o+ f1 g0 E& E B* u9 s
Client.ShowDocument(Document);
! n+ s0 a( Q$ e0 q' WEnd;
# [& s9 P% m' D, L/ U) }" ?+ L2 {! l{..............................................................................}, }# s; x$ a7 h& ^
5 I: \ s* R. ^5 z+ A( S* R{..............................................................................}9 [% c7 X7 O8 K0 o% F' D! [
End.
) y7 e: K" A/ j- ~) I3 @: x" S2 ^5 Z: K9 M
|
|