TA的每日心情 | 开心 2022-11-1 15:51 |
---|
签到天数: 62 天 [LV.6]常住居民II
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢
* z3 G/ X( K Y* \7 e3 E, F: E* g) R+ O{..............................................................................}
! s( t, k$ U* `+ j- L{ Summary Demo how to fetch pins of components. }
! `, J3 m7 M- H: p, w8 t4 @+ y7 L" t{ }
) j( `: M. |" o$ s: u+ \) |{ Copyright (c) 2008 by altium Limited }
5 O; r( K% K( j4 ?6 k{..............................................................................}$ ^* i7 V+ o. l2 F5 o; H
! o! }0 t* y& X, F
{..............................................................................}0 Z9 F7 \. Y+ l# C7 i
Procedure FetchPinsOfComponents_U1;
3 X$ N7 m0 I" J% M9 F* p" rVar
- b- ?' u1 g4 b. S, S" w CurrentSch : ISch_Sheet;
! q+ B# f6 a0 }* b$ y0 n0 @+ \8 { Iterator : ISch_Iterator;4 h' S6 q% K$ Q& C5 J% w8 K3 ^9 D
PIterator : ISch_Iterator;& I; v3 U- m* J6 }
AComponent : ISch_Component;& S1 x3 Z1 j. L F
AnIndex : Integer;
/ x$ }0 {, O+ o1 X2 V' A0 b( u. t: D
ReportList : TStringList;5 s3 Z" X" E& S& W( ^
Pin : ISch_Pin;# Z5 k* H- q& g7 R
Document : IServerDocument;) G& m+ d5 \4 s9 }
Begin
& ?8 e% P+ {2 I* P c- z" F // Check if schematic server exists or not.1 k! w' r0 ], |. L- r6 V8 j
If SchServer = Nil Then Exit;
. O/ y D+ E0 R$ t$ P( Q- g4 B: _
% ?# [4 y( ]3 Z" F! @ // Obtain the current schematic document inteRFace.
4 i/ d: Y& i# Z4 ]; @0 P! h7 U! [5 M CurrentSch := SchServer.GetCurrentSchDocument;" ^& u" ]2 g7 _5 t5 r
If CurrentSch = Nil Then Exit;' \+ F& V$ F4 ?6 q6 ]
2 h2 \0 u2 W9 ?# I6 Z+ _0 N# u" _ // Look for components only
5 H7 O% K. E7 X) y$ x$ d2 k Iterator := CurrentSch.SchIterator_Create;
* }9 K1 ]9 ^+ ^9 O C# N. S$ P- w Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));
0 M5 |( n8 n: v. m. V- e- }/ B5 u) P" ~
ReportList := TStringList.Create;9 S) Z' Q; r: c- j! H# N: w
Try/ S5 K/ \+ w: U& F- V& Y0 T$ b: F' t
AComponent := Iterator.FirstSchObject;4 Q: t* Z2 w S0 E$ \( Q$ k, \
While AComponent <> Nil Do
3 s3 K; I! H5 y Begin
' i, j: e4 D# D Q( |4 O2 @ if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....
. p( D3 L3 M5 Y8 K& W- a Begin
8 G6 |( g& d. r; F3 F ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);
A, P) s( M; S* k+ U; P( _1 H ReportList.Add(' Pins');6 \! |8 Q: X% Z U7 y/ D2 y/ B, l
7 o& ?$ w! p' ^1 T4 G- H+ r
Try4 F( x G' T3 v+ h0 L7 k
PIterator := AComponent.SchIterator_Create;
0 Q7 A7 f7 h! r7 ^+ m PIterator.AddFilter_ObjectSet(MkSet(ePin));7 b+ }0 k* N, [7 d/ W
* _$ R3 y+ t/ W
Pin := PIterator.FirstSchObject;
: F% C9 d0 _1 O While Pin <> Nil Do
% U8 ]$ P! `7 l4 M6 K: e' E Begin
8 G; q. |8 `# r6 H; w V2 {" e, t { ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
7 k) z* L& F% s" N0 Z ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);
' F/ \; S) w# z Pin := PIterator.NextSchObject;% k2 ~$ {' @- Z) ?+ J* ]
End;
( e2 h# i: c, ^ Finally/ R/ g6 l, \: J5 X# E
AComponent.SchIterator_Destroy(PIterator);
" B/ A& n% u: @& f7 K/ Z9 o; }, @) V End;
5 |! B3 _' m, a' ?* }, z9 [. t. r! @' s3 g. W
ReportList.Add('');
/ W$ ], [% r) ?, t
) Z0 _! V8 ^- v9 e" N* C; r End;
( F. _/ ?. n0 t; b) j1 S4 w/ a. @
5 a. M! G7 ~; q( f K AComponent := Iterator.NextSchObject;
- F% x% e: u. P End;: U! k/ Y0 r" m4 J
Finally
1 s% T, U# I; S, z I CurrentSch.SchIterator_Destroy(Iterator);
# q0 g2 U: @2 j- H$ q7 z End;, a- R# |3 B2 q& m P: n$ S' v
7 j! x- x6 b1 T' j4 \# q# \/ P5 v
ReportList.SaveToFile('d:\PinReportU1.Txt');8 d9 r9 u O4 }0 l1 U
ReportList.Free;5 z- P7 g) s: p& V2 v0 x
5 A# H& b* |' Z2 r+ t9 E- ~
// Display the report for all components found and their associated pins.( c* y) `. L- i5 g
Document := Client.OpenDocument('Text','d:\PinReportU1.txt');. a9 E3 U) |% Y1 d
If Document <> Nil Then! K6 p5 t5 s: B8 b" U: Z
Client.ShowDocument(Document);
$ y g; O; {( u, n% S8 B/ g3 _End;
3 o3 m, `, f) d& B{..............................................................................}
! {; L/ e3 P. e- S$ A# b3 W, `7 K) L! o" y
{..............................................................................}/ n( v' t8 {" A6 a4 r; l
End.
6 a& y/ d1 s2 O1 k
( Z* ]0 H& \% g5 o3 u |
|