|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢, f9 G% i, O$ j, t
{..............................................................................}1 _$ U1 h5 f/ B( S9 y4 c
{ Summary Demo how to fetch pins of components. }
* A: J" \1 }3 z6 ^& P9 b" e/ E3 O, F{ }
6 U3 X- U9 i; e; d{ Copyright (c) 2008 by Altium Limited }
; E6 C' v E5 p7 d/ h$ n{..............................................................................}) \) ~ H+ E* o: \
3 ~ W* m! _' z: y9 n{..............................................................................}
8 \. t) P1 V' ^; F% ^% a+ [7 K4 zProcedure FetchPinsOfComponents_U1;
* `# P3 J% X2 ^0 [* [' W+ }Var
3 _8 K' c1 n; G CurrentSch : ISch_Sheet;8 K x6 E* f, ?$ A5 o) B% T
Iterator : ISch_Iterator;
4 z# D/ J4 n" O PIterator : ISch_Iterator;+ T* Q) Z5 s( c+ S- d! o# l
AComponent : ISch_Component;
4 I3 N1 w4 H$ G+ X3 W. Y) w9 T AnIndex : Integer;
, j7 l0 l5 ` [! W( R' ^4 i6 p! L
' I8 _; h3 i" p; w ReportList : TStringList;
( R. \# z2 V C2 F5 E Pin : ISch_Pin;$ s; @2 J" j8 ~
Document : IServerDocument;
) C& W ~* S( l3 W3 lBegin! h6 B$ R5 `( p% {9 _1 F. e
// Check if schematic server exists or not.0 H+ C6 I, {8 q0 c8 @( ]
If SchServer = Nil Then Exit;7 K( s1 d- h1 m) L4 m& W! l0 J1 g- c
! U* ?! V: f- `7 A/ ]3 e // Obtain the current schematic document interface.
( j. ~2 D+ T; B k! n k. f3 ] CurrentSch := SchServer.GetCurrentSchDocument;# @; S& K/ w. M! O+ v1 n6 i. }; h
If CurrentSch = Nil Then Exit;2 }$ j2 S* y( ^% \9 s* `
b7 V0 v7 t3 ? f0 {$ H% ] // Look for components only
7 n! K# }' r6 ^2 t Iterator := CurrentSch.SchIterator_Create;
9 m: R8 r/ c2 X; \) v* Q& o! c Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));: w# u: S" c, n2 L
6 R( S' I$ f4 j! ?8 ]/ G
ReportList := TStringList.Create;" `! P- N$ y6 @/ Z. w }7 f
Try
1 q4 k f9 m7 I& \5 h X AComponent := Iterator.FirstSchObject;
$ e0 b1 B' T- f6 c2 u- p6 ~ While AComponent <> Nil Do7 s/ C2 b) y# I4 G% P: D+ s! E) N; Q8 R
Begin
0 _8 e" n3 h5 J6 {( x9 I if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....4 z7 j. E: A8 e5 Z" _7 s
Begin) @" e) B1 O7 O5 a0 j
ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);. d. k2 e5 \5 P0 c" N, c8 n Z
ReportList.Add(' Pins');
) q9 B. [. l# b# |3 ]! J) g8 p5 u$ j6 X# i
Try
1 C% ~ p$ X- e9 O K1 P. P$ J, \+ | PIterator := AComponent.SchIterator_Create;
1 Y& y3 f2 M. J* J. x1 T PIterator.AddFilter_ObjectSet(MkSet(ePin));) d( i$ x, C) F o$ ?% A
/ ?( B/ v1 S0 V: d+ N% x Pin := PIterator.FirstSchObject;% j& Y5 }' v8 f) j4 m
While Pin <> Nil Do! @# P1 X' P- V9 l
Begin
2 J: B- o2 Z! B' ]( T { ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
3 u# k' H2 d3 b; c6 k ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);! B! p: p1 ]5 I
Pin := PIterator.NextSchObject;
9 T' {1 ?8 {2 _; j1 ?$ S& V0 t+ y End;
8 c# ~2 |7 D) E8 D Finally7 C% G/ F. J( o4 C. ?& p: T0 H# A% {/ @, F
AComponent.SchIterator_Destroy(PIterator);
4 t; J6 o# |6 X, D1 G End;
; A7 @: f- _: J
/ l: R- Y ^& L. i* a& R" x8 X ReportList.Add('');
( z; B$ C3 _& F! p3 Y' a
7 M( k Z7 R* U: F End;
/ t% l7 u3 m* g( m j( j h. W
: U0 v6 A8 G1 ]1 J5 G, Q! w% h AComponent := Iterator.NextSchObject;
$ F- u2 k3 g1 S) A End;( T. {8 \3 {% ^8 A9 g: \
Finally
1 I0 ?( o8 H* I CurrentSch.SchIterator_Destroy(Iterator);
6 O1 L4 d; o: p& p End;7 x: v+ q \( |, ^% a0 N, p" g2 r/ B
p3 t: [4 b( e' j0 C ReportList.SaveToFile('d:\PinReportU1.Txt');
$ P% L, ^! T& J0 ~! E ReportList.Free;
, q; p- U- v/ p& H& V
* M T2 ~" H* I2 L) m0 B8 k // Display the report for all components found and their associated pins.9 ]: s. O5 b" v0 G
Document := Client.OpenDocument('Text','d:\PinReportU1.txt');
+ X4 ^/ ~$ M" W5 ? If Document <> Nil Then: d" N4 e6 v- I) Y) I7 c
Client.ShowDocument(Document);6 b. P5 I# [6 I: m; U
End;. U4 k; A' V$ u( k/ N7 C
{..............................................................................}4 R% j1 H: @# Z1 i: N( t4 b
: e$ F+ q" k, J7 h
{..............................................................................}& M+ w0 i$ J3 B: j! X4 R& V
End.
2 e" A5 O- j6 [ p3 k$ T. M
. H* F# \3 f% d* x( h |
|