|
本帖最后由 bigmomasd 于 2024-12-17 20:51 编辑
; K! I. W! s: N2 C8 @5 \. Y% c0 x" ]: ^1 u& z
在tcl command界面输入- # 此脚本重构tooltip功能,使得鼠标悬停在器件上面的时候显示器件的封装信息
! V, S% @' J9 t5 M! Q - # 判断是否启用工具提示功能# W8 D* {, [+ Z/ _' l, |
- proc CustomToolTipForPageObjectsEnabler {args} {
7 c; L$ O/ J h8 U2 p. A8 ] - return true1 C4 d5 W: X. j/ l' P
- }
" Y/ ~! p7 O" k) a. R( ~: |7 J
, |$ `" v S- n. S8 l4 V- $ o9 B* w( \- x! Q" r. g
- # 获取器件的 PCB Footprint 属性值; p t* e4 y) S! W2 K$ ^9 B
- proc GetCustomToolTipForPageObjects {pObj pSchOcc pName} {
) e- L- H: D0 y - # 定义属性名1 K% f% p: n9 v. j
- set propName [DboTclHelper_sMakeCString "PCB Footprint"]
; [6 y; r3 {3 l9 m* D - set propValue [DboTclHelper_sMakeCString]
5 w$ ?) d% ?# \" P: t - " Q- X$ ]+ l; L! c% W: ]/ E- k
- # 获取属性值7 J3 p Y( W2 \5 t7 y6 I
- set status [$pObj GetEffectivePropStringValue $propName $propValue]
, K3 e# I9 R, D& v, | - ; q; H9 @' r2 j* t6 o" P1 q
- if {[$status OK]} {
- v6 n) @$ c! N/ f1 j a/ [. u, G - return "${pName} --- [DboTclHelper_sGetConstCharPtr $propValue]"
8 t8 X4 T* G0 b; P ^9 M# G4 i7 O - } else {
. _; x; h; E% D3 y - return "${pName}"- \4 u B- M7 o& `/ [. u J
- }9 B% S2 Z# n7 q1 L* a5 L
- }
/ j; d' h. G, X+ b2 `3 [, [ - , y1 u7 h4 A; Y9 Y3 H
- # 调用 RegisterAction 并设置参数8 m4 C& ^/ n9 P% B: Y
- RegisterAction _cdnGetCustomToolTipForPageObjects \% p1 z$ {; N( b" m9 o
- CustomToolTipForPageObjectsEnabler \5 _4 z8 @3 _+ X7 p0 L7 W- k
- "" \
3 Q/ e% ?' }; v r* t - GetCustomToolTipForPageObjects \
: \& P' y+ G( z# [0 @7 `0 i - schematic_page
复制代码 然后鼠标移动到器件上方,显示如下:# x( c5 |) b* l: f
便可以成功显示器件的封装信息。0 j0 t/ f4 j( T9 v' Z' A% d5 Q
v' h6 G- [7 L4 _* {如果要每次打开cadence就加载此功能,可以将上述代码保存至一个tcl文件中,如show_pcb_footprint_tooltip.tcl文件,然后保存到<Cadence_Installation>\tools\capture\tclscripts\capAutoLoad目录下,重新打开cadence即可。
, n z! ]5 j( G4 k- g! R. r! Y& P- X% ^ `) t
|
|