TA的每日心情 | 开心 2022-11-1 15:51 |
|---|
签到天数: 62 天 [LV.6]常住居民II
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢
, X: s5 P- f$ v. l- ]6 Y{..............................................................................}
* i4 s: |8 h. c `, a; @6 L{ Summary Demo how to fetch pins of components. }0 v9 f. Q3 G7 z/ o
{ }
U7 C x+ w/ ]{ Copyright (c) 2008 by altium Limited }
7 e L# R! \; f0 S1 b, \{..............................................................................}3 ^1 W' W+ s/ T2 A2 V% G
$ N4 D r3 \! d: X) o
{..............................................................................}
8 M; J0 e' [1 [( a: | A1 jProcedure FetchPinsOfComponents_U1;3 l+ Y3 p0 M% Z6 b3 h
Var) z/ r! @3 ]1 e, S+ j k
CurrentSch : ISch_Sheet;4 G/ ~8 L* E4 [! r' `$ e& G$ u
Iterator : ISch_Iterator;
6 \0 F2 Y- Q) p- i PIterator : ISch_Iterator;
& a. q7 G; I. Q5 w; X) J AComponent : ISch_Component;/ k$ _+ F. a m: a m
AnIndex : Integer;
1 y0 e( k* e" B3 ]: T
; a/ k5 }4 Y8 u; v0 c* q, X7 a ReportList : TStringList;4 f' _% ^* Z( I* m
Pin : ISch_Pin;$ t" \: R: y6 ^3 B
Document : IServerDocument;
# e! L; Z0 u( y3 lBegin7 `( } x/ h. i$ z) g$ P9 \
// Check if schematic server exists or not.
8 N) [; C/ ]6 n# }5 }6 v1 W$ C If SchServer = Nil Then Exit;
0 y$ r# s$ }4 t F" }- O1 I* @) B
+ ?7 p" W# M# g- s. \ }: { // Obtain the current schematic document inteRFace.
0 \8 E) J- S1 A' j6 F1 h CurrentSch := SchServer.GetCurrentSchDocument; z. M+ h6 _2 K" L6 [
If CurrentSch = Nil Then Exit;
( }( T, J$ w* K, y1 J
% P+ `8 a0 u+ ~3 ]. V2 n // Look for components only8 V4 I1 V/ E2 K1 p; o/ a( c" m
Iterator := CurrentSch.SchIterator_Create;1 G' Y& [3 U6 X; \. ?
Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));
5 t% [" ^' U* h* R% R1 N# {) _" Y& s/ N2 v S0 M
ReportList := TStringList.Create;
( ?# I. i/ J: x0 o; g/ Z Try
0 O8 c+ {* [+ o' z& ] AComponent := Iterator.FirstSchObject;9 C9 Q! z4 o% z" y
While AComponent <> Nil Do4 C+ Z; i2 [4 ?3 i
Begin3 Y, }0 ^' n! _0 X2 D4 j3 }
if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....
$ p% X7 @7 F: ^1 H( k0 I Begin) s: f v$ x3 M" P
ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);. _4 p( A# o' H8 r `) @
ReportList.Add(' Pins');9 }- u) K1 K- t* Y7 i9 o
. R' Z A1 i2 f& g. J0 q) f# C Try `6 U5 F; [/ `: b5 ~0 F
PIterator := AComponent.SchIterator_Create;& ^+ P' Z* S# L8 d. N% i
PIterator.AddFilter_ObjectSet(MkSet(ePin));
2 x- A3 I9 Y9 m% t1 Z- H
0 J. l- T$ t0 q% [ Pin := PIterator.FirstSchObject;6 I/ ]/ R Z: n
While Pin <> Nil Do6 K$ l4 t5 O) _7 C- J
Begin
! C# j2 V7 e, Y$ J/ ] { ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }% g3 a5 {$ Q6 T2 _% F# p' l
ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);
_( r0 E8 ?5 h- \. N2 I+ H Pin := PIterator.NextSchObject;
W1 ]4 b! Z j0 B. J End;1 U' W: N- |* m! z
Finally( O- n3 C2 \% I% v- g
AComponent.SchIterator_Destroy(PIterator);) B1 I3 }% u) G" U6 {, w! S
End;9 r: O N5 p. x1 k; U( Z* E
/ k' ]% Z0 ~+ j$ [8 k ReportList.Add('');
9 R7 ]& }* l- I5 e
( O# c o+ k/ P9 M6 h ~8 z6 @ End;
% V2 z9 ^0 _4 H7 P4 a6 N/ f7 h9 L J) o$ U& ] H
AComponent := Iterator.NextSchObject;; M: y4 I; d) Z+ L! L2 _2 }. Q1 G
End;
8 u! F) s0 @: L" N \ Finally
! n. a9 S4 N$ R$ f& R3 J X CurrentSch.SchIterator_Destroy(Iterator);
! |0 q: @7 y+ E, B) S! M% B End;
5 @5 ]" ~; t) b8 [, ?% R8 [1 K5 u6 `6 w& K' t# g2 F! i" S" K: z
ReportList.SaveToFile('d:\PinReportU1.Txt');
* j$ v) |1 H% J3 n& \ ReportList.Free;
+ r' G" i7 U, A9 K; ], z7 P# ^$ Q0 X
// Display the report for all components found and their associated pins.
. W7 O5 j) s; V) o4 f. v Document := Client.OpenDocument('Text','d:\PinReportU1.txt');. F; E' |6 l2 T
If Document <> Nil Then* U: D" d& t# }
Client.ShowDocument(Document);
: P) Z* e) i1 R/ Y" o, REnd;
) ?7 E5 M# P& a) J{..............................................................................}7 O8 v) t/ _* J2 k! _
* \ u/ X3 h( F' a; P1 Y# ^# \( v{..............................................................................}
! P3 E, l: Q& m) V' [4 u5 V: O, ?End.
5 d- J, b6 p+ E
: O* U& E5 ]$ ^. R( @; O& i+ a |
|