TA的每日心情 | 开心 2022-11-1 15:51 |
|---|
签到天数: 62 天 [LV.6]常住居民II
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢
9 L/ G, G6 a3 z6 r1 S, q2 L{..............................................................................}
3 h7 Q- I$ v* q{ Summary Demo how to fetch pins of components. }
' y0 a5 \" J$ R V9 o d* \{ }
- l+ G5 Y# |4 ]! `: B" X% G0 ~{ Copyright (c) 2008 by altium Limited }
. w9 _# y, N b7 b8 c6 T{..............................................................................}0 Y8 t6 D# w5 m; O; o
# q3 b$ x" Y' _
{..............................................................................}- k5 Y; s+ {5 w3 V5 n( A0 r9 m
Procedure FetchPinsOfComponents_U1;0 J5 H9 ~- L9 C7 h; Q! b' X# v
Var8 Q; h; c# L( [) t
CurrentSch : ISch_Sheet;
' h: F/ Q) R+ f: {% ^# M8 q+ _ Iterator : ISch_Iterator;
, t9 ^+ I. M' z3 E$ z PIterator : ISch_Iterator; q. f* H( n' I2 d$ x
AComponent : ISch_Component;6 I+ N' o; j& F* u
AnIndex : Integer;7 m2 W) a5 s ?0 l
9 N% n. @, @8 u' U, E% {
ReportList : TStringList;5 a6 t4 ~/ }) p# A9 X
Pin : ISch_Pin;4 _3 C$ v* H/ B% m
Document : IServerDocument;; u: d) `0 d$ s* D3 ~7 w
Begin
5 J1 x- j, y9 r- a // Check if schematic server exists or not.% z$ y7 U2 p9 Y
If SchServer = Nil Then Exit;
Y$ w @2 [1 ~' q4 \# \. c
$ s$ \ \+ z& v2 k, H // Obtain the current schematic document inteRFace.
+ p- K- D) g% e' D* F' p CurrentSch := SchServer.GetCurrentSchDocument;' z. H6 ?( c3 I3 B; B
If CurrentSch = Nil Then Exit;
3 G( x9 e& \- j, @/ h' U
3 b1 M- X+ A7 W) R // Look for components only6 j( w* Z' b- Q, _7 ]5 T
Iterator := CurrentSch.SchIterator_Create;
7 p. _7 e y: [( X Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));
7 g: F3 Q, `6 \0 x% ?; [3 a6 Q
, K7 B& _7 }& y" ?& f ReportList := TStringList.Create;( x9 w) X, b' f
Try
) Y1 o- n6 r* b' A AComponent := Iterator.FirstSchObject;3 h' u$ M6 d7 M8 z
While AComponent <> Nil Do! [/ \0 S. U' {7 g+ }3 A
Begin- t- S% S T/ Z% E
if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....
' z7 c% P0 s5 d: N- K) I& m Begin
% w# W% j2 j% V6 V7 @0 f+ I+ G ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);
. `4 i8 C" T" q5 n/ @ ReportList.Add(' Pins');
8 G' u- I" E* T, K: _' j7 T# s
: ^% g* I, [2 B4 C5 f9 \8 r Try* u" s' F! z$ I* f. D1 T( i: q9 s4 t7 P
PIterator := AComponent.SchIterator_Create;
' @. h2 Y: x g2 W. q5 B) Q PIterator.AddFilter_ObjectSet(MkSet(ePin));
7 D/ A0 Q% R2 b
6 ?) h( P9 O( @/ I Pin := PIterator.FirstSchObject;! I" K; ~% m5 Y" _- }8 G) U8 n, G( h
While Pin <> Nil Do
; V& N4 T6 ?8 o7 w: w Begin( ?& z! b9 h5 j
{ ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }
$ M; M0 _0 G& b6 [& e) x ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);1 P, h9 X, Z4 x& m. ]. p2 \
Pin := PIterator.NextSchObject;! q2 u2 R0 n- P/ f% g. p' O
End;
1 c6 f' L2 E! w M# Z: h' C Finally. g- l8 Q# R# B% _- a! R
AComponent.SchIterator_Destroy(PIterator);; A$ F3 T; w* t7 k
End;; J( s' e3 y7 j8 }2 `9 T5 F/ h
) I- @* i* o$ ?8 i ReportList.Add('');; }, @6 A7 I3 X b7 r' L/ H! L
2 Z' |' S) Z1 c; q+ C( S1 h
End;& e" R8 w5 }' i, u7 c; s7 H
* e3 {" ^ G# a( m6 M5 g/ F# E* C
AComponent := Iterator.NextSchObject;7 q5 j1 R5 b6 t+ s
End;6 J. s# y4 s8 ~
Finally8 a8 M b9 }5 i* p( s
CurrentSch.SchIterator_Destroy(Iterator);
9 I$ R" l, C/ u# y K End;
" h6 Y6 G& g/ x3 L- c. F3 g0 L
( }7 z! B \) A ReportList.SaveToFile('d:\PinReportU1.Txt');
! n& |+ g' S& \3 I4 z0 r _ ReportList.Free;
, g" P$ _8 W7 B2 A+ U! D; s$ S! B. @
6 O# Y; ^+ \4 R$ [ // Display the report for all components found and their associated pins.4 \2 B4 i! X& [% _
Document := Client.OpenDocument('Text','d:\PinReportU1.txt');
5 _/ Y* @. X* f8 Z$ ]# F If Document <> Nil Then, }+ B- j6 L/ X. n- O# @
Client.ShowDocument(Document);
6 E/ i( z. P- F* }! D! YEnd;
. s, H* o: f" z{..............................................................................}5 ?( N' t5 c: e! |, a" u
8 z# k" b1 s8 R6 X8 Z- W{..............................................................................}$ F6 N9 f* D, e# v: S B
End.9 b$ `; R, Z8 Q: }5 }7 Q# a A# q; P
7 G% f) _ y. R% W
|
|