|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢 \. W7 b/ v- v2 H8 c2 r( e
{..............................................................................}) u) \) F7 V# {* O+ Z9 o
{ Summary Demo how to fetch pins of components. }7 ]7 K" e! Y2 `) G
{ }4 ]2 \ D) x7 x
{ Copyright (c) 2008 by Altium Limited }# g: Z! Z, U% d' c- x/ [% w
{..............................................................................}
4 b+ x# Z# Q2 A6 e+ B) a2 N6 \* |& V E+ ~
{..............................................................................}
- o" C/ O+ o+ y0 Q6 n0 F# ]Procedure FetchPinsOfComponents_U1;
0 }' Y! w+ H/ m) z' A* S) t3 FVar
- a! F2 L& C+ V7 z9 P( L/ w: n CurrentSch : ISch_Sheet;! p8 w3 }2 s; j% p3 B; w
Iterator : ISch_Iterator;( c7 ]9 w/ ?' a5 l/ G; W3 V4 {! `
PIterator : ISch_Iterator;% x0 F3 _! L% p: c9 B2 a4 U" e
AComponent : ISch_Component;
7 m9 _* a5 Z; f AnIndex : Integer;, c2 W6 L8 o( Z" m {3 P5 x. X0 i% m
# |; l: W) {% Q5 p ReportList : TStringList;
/ ~, H; |9 Z: E Pin : ISch_Pin;
' o1 O; E! e; _ Document : IServerDocument;6 Q" i3 g& N6 Y6 v% ]7 b
Begin& p% g( I% Y6 v" R0 @- n
// Check if schematic server exists or not.( f# E* q" D5 }# g# }
If SchServer = Nil Then Exit;4 N* ], J6 q3 R% F1 M3 A
* Z% A0 B9 R* C, ]* _; A( e // Obtain the current schematic document interface.
4 z9 L) K1 ]( ]; o0 n1 V CurrentSch := SchServer.GetCurrentSchDocument;1 _7 Y t: {6 c0 r0 K D$ \
If CurrentSch = Nil Then Exit;
6 ~4 W2 F. h2 y9 l4 ]2 ~" {, R' K, `3 e" P5 ~% z% }- q
// Look for components only
5 i: i; i/ |" ~9 }* Y Iterator := CurrentSch.SchIterator_Create;* m! G7 y4 `& s1 l3 V, J
Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));) c$ s2 K- a: L, K$ Y) Y
* S/ j: O U9 _9 d" N" J ReportList := TStringList.Create;! h9 O4 p9 K) O. X; V4 u1 ] r a
Try
& p( W: p7 @. i1 m AComponent := Iterator.FirstSchObject;
: G; _9 ~% u4 b5 I h. _ While AComponent <> Nil Do
, X& @ e3 [* s Begin& c3 d. B, {; e
if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....* k8 @6 |7 O6 E# C
Begin
% B! V _4 Q, W# r ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);9 p5 n* [1 d0 c: R8 l8 y
ReportList.Add(' Pins');
2 S: N% I1 |- a T d% z+ W# V3 \( Q. _. A8 C
Try' X- h* [; k0 C* f( w6 i
PIterator := AComponent.SchIterator_Create;2 h! r: P9 [9 z+ q5 A! ~$ X
PIterator.AddFilter_ObjectSet(MkSet(ePin));
: _$ _/ |: F* k8 i& y
$ a; Y$ b2 k" z; m% Y7 ^ Pin := PIterator.FirstSchObject;$ J! ~/ D+ l q* V' I
While Pin <> Nil Do; Y0 z9 P( j1 p1 g
Begin
8 L6 \8 V7 p+ h. [: Q { ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
1 l- Q* s' h1 F x* R- a; R ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);
$ V6 a/ V! Q- U6 c Pin := PIterator.NextSchObject;! d: s4 q4 A4 `" q/ R
End;
( n8 w, z; N9 O, C Finally. q2 K$ d9 J8 X5 @1 [) i! g
AComponent.SchIterator_Destroy(PIterator);9 }$ `, i# I" g
End;
/ Y& K7 s X1 R0 }2 H' D/ E: \0 K0 T3 N m4 G! B+ X; _ F
ReportList.Add('');3 M0 `% }" N5 M+ ~! c9 B
p1 `+ k0 z( A" x3 n% y5 G End;' a. D& e( j/ { k9 q$ K
0 J" D; t; p6 S% ]
AComponent := Iterator.NextSchObject;
4 a; Y% j5 R7 B: c. Z2 s End;
8 X7 \! g; |, U$ s5 R" I Finally
, H% |2 n8 t- C$ M2 R% Q) ? s: h CurrentSch.SchIterator_Destroy(Iterator);
( J' \$ I3 }+ S& F1 x End;! S% I1 k+ R( B' g/ F2 t
8 t9 P9 ~! h" G3 B6 o; ` ReportList.SaveToFile('d:\PinReportU1.Txt');
) ~* L1 h: M: }+ _- j' t ReportList.Free;
& D- I7 B( g7 F3 G w4 i( |3 y: ~; j& _; U9 U9 V+ ]
// Display the report for all components found and their associated pins.
1 N1 p) }+ p E+ Q( }, U Document := Client.OpenDocument('Text','d:\PinReportU1.txt');$ z. S& `2 t, G8 ~# D$ U
If Document <> Nil Then
; d5 _( S( \, K Client.ShowDocument(Document);
% v8 x3 _% M% t Y+ xEnd;
p: T# y: R8 y& Z1 ^{..............................................................................}" |, K0 T: `$ t* s: M: c& x
3 Z3 D. q0 K T# p{..............................................................................}/ s, ^; e% z# F. d; F
End.
* J& n. P J7 h! \, r5 P, n
# N5 @# ^) a2 {! f2 `& ` |
|