|
EDA365欢迎您!
您需要 登录 才可以下载或查看,没有帐号?注册
x
AD设计的原理图,FPGA的管脚名要做一些改变,库里面的fpga symbol是通用的,不能改,只可以在原理图里面改。通过双击原件,改pin的话太痛苦了,上百个管脚,在edit pin的界面上不能一起copy和past,只能一个一个改。有没有什么快捷的方法一次改多个管脚?考虑用脚本,找到了个ad的读管脚名的脚本,修修改改可以用来读指定的某个原件的所有管脚,再在文本文件里面改,就可以大量的拷贝了,但是不知道怎么写回到ad里面,有高手指点一下?谢谢
8 z; [; G3 z, d6 H{..............................................................................}/ l5 f- T* S1 k) l+ @
{ Summary Demo how to fetch pins of components. }
9 n- X' j7 }, f1 q{ }
7 n0 M6 o- ?6 U3 E% j9 Y{ Copyright (c) 2008 by Altium Limited }# ]) n) j5 \8 ]2 Y5 R: r
{..............................................................................}: k, r" K1 f6 Y7 `2 f { A$ m
/ i6 _# w- D& r{..............................................................................}; D; ^$ Y+ D6 n0 ~
Procedure FetchPinsOfComponents_U1;( t# q; P/ Z2 y7 c. f$ A; ]% A8 H
Var" C' L5 G( e! T- z- J# C8 b; {6 G
CurrentSch : ISch_Sheet;
8 T( ~) }9 ^5 E/ `5 `% J Iterator : ISch_Iterator;
4 ^. p" z$ Z" o; v: s. n3 N% p PIterator : ISch_Iterator;
. m2 b, \2 H2 ?: E% V; }6 X7 } f% \ AComponent : ISch_Component;/ c4 a3 L3 @' ]; L0 [8 h8 h) ?9 H
AnIndex : Integer;
8 {$ ?) z, j0 \" V) j' T3 o9 l; c* q$ ]5 Y- M' `+ \
ReportList : TStringList;
! c2 f5 t! J% B6 X' r. I Pin : ISch_Pin;4 Q% H# j0 Q7 D9 z9 q& [! p
Document : IServerDocument;' j/ T$ B/ Y1 ?9 R* G+ d4 f
Begin( ~. C$ B* x4 c9 A9 e: X2 _
// Check if schematic server exists or not.% N0 P) _! `) Q
If SchServer = Nil Then Exit;" V* {1 i: u3 g2 B/ u3 W
2 ^$ o; z B) ~2 X4 t9 j
// Obtain the current schematic document interface.
, l8 C2 ]% {$ k2 O0 u d CurrentSch := SchServer.GetCurrentSchDocument;
1 q' C( O( W0 B$ t+ ? If CurrentSch = Nil Then Exit;
# R8 o2 R" h2 q1 C5 D8 f$ k. K! ?% J" Y! `+ _% k
// Look for components only
/ F/ U/ {5 E* A Iterator := CurrentSch.SchIterator_Create;
, }! k* Q* I( R& m# G: F Iterator.AddFilter_ObjectSet(MkSet(eSchComponent));
4 R! L1 ] k1 v2 _4 R' |1 a5 S9 Q8 w# y
ReportList := TStringList.Create;
, ~! @# J. F" Y. O$ j" A: { Try
% X2 Z4 z2 U" G# k/ C7 ` ?$ } AComponent := Iterator.FirstSchObject;
/ t( z1 V/ O% x2 h( K6 j& W) z5 n While AComponent <> Nil Do
7 {# x0 P, m$ N' b, R& Y/ d Begin+ M# w# Q- f6 u6 c6 p. z* x! H
if AComponent.Designator.Text = 'U1' Then // change to the designator number you want.....0 L8 Y# L! {# y1 p; V( h
Begin
! _( Y; j- ^( J* Q0 ?# z2 @ ReportList.Add(AComponent.Designator.Name + ' ' + AComponent.Designator.Text);
# x0 F7 Y- S9 i% f J" J ReportList.Add(' Pins');
! v m6 O5 n; W A
* b R7 N1 s! R9 R Try! d! T& l2 A. s* h% N" H
PIterator := AComponent.SchIterator_Create;
0 V3 S+ d- j6 K( C- Y/ Y PIterator.AddFilter_ObjectSet(MkSet(ePin));( e) z4 y/ U5 H! V: d& c4 v
- H7 G( a3 W ^9 g9 J( H$ ^
Pin := PIterator.FirstSchObject;# r- x# Q4 d7 \! X
While Pin <> Nil Do
; k9 v" O: X# V: B% h- d8 i Begin( R$ k4 K0 J% P9 t+ w0 z! T. r5 N# }- B
{ ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator); }/ W0 _# N4 d" I
ReportList.Add(' Name: ' + Pin.Name + ' Designator: ' + Pin.Designator);' J+ c" ~5 l) F
Pin := PIterator.NextSchObject;, V' @ v4 _0 W8 }" n
End;5 D1 G7 s2 j% U
Finally/ M4 r/ K! X/ O; ^
AComponent.SchIterator_Destroy(PIterator);
: \6 w' A* ^- X3 B& L% Y- s- u End;
; u, I6 w0 y9 q. X. `) Z
2 a' {/ N. |2 _3 ] ReportList.Add('');& `: Z) ]( K6 ?0 w' t% J
/ i% l* ]' L# ~2 C
End;+ H5 e; o$ ?% o3 [
8 E" U. d8 }3 @ w1 u AComponent := Iterator.NextSchObject;
. D1 J$ Q* r1 L, b4 Z4 a; `3 { End;
4 E$ H Z( J! B$ C3 D; p) \% T Finally
4 D6 h" T. h& L5 T CurrentSch.SchIterator_Destroy(Iterator);
4 E' Z- U$ R: f1 p3 X End;
" u. P; v1 F n, }' N, u: g. K0 ~7 K0 o
ReportList.SaveToFile('d:\PinReportU1.Txt');" [2 R! f. R; k( q3 n
ReportList.Free;
# Q! G, R6 H/ `: U2 P, b9 o. L1 s9 f3 |' r
// Display the report for all components found and their associated pins.+ v5 i2 C6 w- T7 ]$ A( X
Document := Client.OpenDocument('Text','d:\PinReportU1.txt');
i+ ~6 d! N& J3 f0 b7 b8 w If Document <> Nil Then h/ \ \ I8 D& B- t% i+ t
Client.ShowDocument(Document);
3 o7 a( e# c1 F( hEnd;
# X8 y k8 G m) o& J" {! E' [{..............................................................................}0 }' d* U% T% ?% h9 [
0 A+ o# _) f4 d; g. g* a5 i
{..............................................................................}% E* ~- j1 Z- \. W
End.& X q5 p2 V. ^7 p! M5 t; q# s) u
* `) }5 Q& w {4 Y% |! h
|
|