TA的每日心情 | 开心 2022-11-1 15:51 |
---|
签到天数: 62 天 [LV.6]常住居民II
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢$ y2 E' G* c7 j. Y. i Y5 n2 C# Z: F
{..............................................................................}
O( N' _( _1 L{ Summary Demo how to fetch pins of components. }% m( X9 Z+ S3 C
{ }" F A: P, c& b+ Q0 G
{ Copyright (c) 2008 by altium Limited }
& g. P5 B1 G! i{..............................................................................}
3 p# v2 @* j' E+ U! s7 Y9 C! H& G( o; z
{..............................................................................}
) n; U' a6 E' ~Procedure FetchPinsOfComponents_U1;4 `* X7 G0 a7 v/ x
Var
; s. k5 [6 }' v- [/ X) ~ CurrentSch : ISch_Sheet;
. F" i9 G5 W S7 m- Z( M Iterator : ISch_Iterator;
0 x/ A) o$ {' Q* P( } PIterator : ISch_Iterator;
: p" V+ e* J6 O& ]; f1 U7 { AComponent : ISch_Component;- J6 R+ ]$ {" R! N( V3 y
AnIndex : Integer;
0 M. V( ]' C8 s4 Q5 |: O1 k$ _
6 A* b# d. I$ t ReportList : TStringList;
, ^- E* ]2 p$ V; d% h( J) ?2 C" C Pin : ISch_Pin;) C. V( _3 E0 q% B) b
Document : IServerDocument;
1 O4 [3 {$ i% Q: ?$ C5 s7 XBegin6 u/ G6 C& W6 U$ d
// Check if schematic server exists or not.
& i- L" s, |9 G' m0 @* a( d If SchServer = Nil Then Exit;- x: P- O" ~/ u: w* B
. n f% U6 ]/ p) E% n; P* k9 j& a' [
// Obtain the current schematic document inteRFace." `; }: B& Z1 X1 V% O F
CurrentSch := SchServer.GetCurrentSchDocument;3 {# f* X8 U$ g: }. {& {3 ]
If CurrentSch = Nil Then Exit;* w5 M! N4 D, v2 X( u+ z) A
! i5 @5 ]3 d+ ^2 f' ^3 g
// Look for components only) x$ i2 M1 h/ j5 t# b
Iterator := CurrentSch.SchIterator_Create;
3 ?# l g8 m% D! b6 K3 N+ P# C. r Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));
/ C: p1 g+ Z3 v* Z6 e& E
% P6 s1 E0 i6 `" v& l ReportList := TStringList.Create;
: t+ ^& `# O0 e5 e' E Try; d) y/ Z6 F" d0 Q
AComponent := Iterator.FirstSchObject;
% t. C* s5 E2 ~ While AComponent <> Nil Do
' A; b% k2 s. i" p: P Begin
+ B w; @9 P7 V3 _: N if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....
5 @' ~5 N8 J7 n8 T/ @( t Begin; s! n9 i% e9 ^' u/ l
ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);
& E. c3 x% T7 t ReportList.Add(' Pins');) {: {* {% _- V$ q- p! q
2 u0 E' r$ l; x1 Q& `. e6 f
Try
& r1 h" H4 S! { PIterator := AComponent.SchIterator_Create;
5 @7 R; z+ |8 n! Z: m( W- T PIterator.AddFilter_ObjectSet(MkSet(ePin));& J+ L3 {& i# N m- ]; P
) [* n% x8 t' p! y
Pin := PIterator.FirstSchObject;5 Y7 i7 O. l% `' j& P
While Pin <> Nil Do, O0 N0 \) q3 p; }/ O8 U3 j. u
Begin$ d0 J- e i9 T/ C. D* c& R
{ ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }/ Q5 a; k7 {4 A% g2 I
ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);9 K" J; W @6 Z2 o k6 S
Pin := PIterator.NextSchObject;
7 p! w& I- X+ n; w End;7 h- Y! `( Z, M( q N9 U3 p% n
Finally
" @" P$ } d4 K, y% K( }: _ AComponent.SchIterator_Destroy(PIterator);! Q! r- ]- q$ f5 f/ `/ J
End;
# C8 H- f: n( F4 Z
0 N6 i1 ]+ u9 T# h6 ~, d. s ReportList.Add('');8 b# i7 Q0 g1 I9 l5 c$ O9 ]
% C! \ \+ x2 x9 P, Z
End; N M' T& t( R4 W
3 n$ s/ S& N8 _$ l AComponent := Iterator.NextSchObject;
9 ]' V* O4 [ M5 L2 E4 V End;; U! F9 K2 t$ ^
Finally6 p ~2 q8 G6 ^' ~
CurrentSch.SchIterator_Destroy(Iterator);( U5 ~" I. w/ O( _* j7 f
End;
9 G9 H7 Y' v- ?' e) B
) e z7 ?' [8 c" V9 y2 d ReportList.SaveToFile('d:\PinReportU1.Txt');
5 Y: K, P( a7 d1 ~ ReportList.Free;
6 y8 ~; W/ T7 Z* y6 K0 l6 y2 h: S) E7 w: m0 y
// Display the report for all components found and their associated pins.
& A/ w, d. j8 n' b# f; m8 n9 ? Document := Client.OpenDocument('Text','d:\PinReportU1.txt');
" L. A, t* k8 Y If Document <> Nil Then! p% w2 n1 A' m) n
Client.ShowDocument(Document);
% l; @; V% b1 A- IEnd;9 u# F9 O1 ~7 y* V# k
{..............................................................................}7 U3 J$ p* D/ v8 `/ G6 V
" X) z2 @- _, i" @5 i{..............................................................................}" \6 @+ P4 H3 g; s* j1 @
End.
5 ?+ M3 a$ I3 g2 Y$ D8 {+ m7 R: R; r) R$ o
|
|