TA的每日心情 | 奋斗 2025-7-7 15:38 |
---|
签到天数: 83 天 [LV.6]常住居民II
|
仅供参考- axlCmdRegister("csa" 'dbCheckSymbolArea)
% Y1 o& \6 E: e7 p- q" [ - ) Z$ U& W: b0 b2 J
- ;; How to use
- s9 A0 J9 G; z A# V9 ` b - ;; skill load "test_calc.il"
: }0 k+ ~: m- D8 f - ;; csa- M% T0 Z5 E* E4 r; M, p
- 0 B2 |' o/ ~; q a0 c* {
- procedure( dbCheckSymbolArea()
6 `. p: b) ?! y F6 |0 Y' x - let( (plcbnd area (sumPlc 0) shapeOutline sumOutline)
1 ~, a% B+ E1 a$ N4 O+ G- @9 Q - Y9 Z3 S* b. O" g- p- l
- ;;calc area of placebound of top symbols0 y+ i& B- {. A" _2 a7 k" H
- foreach(i axlDBGetDesign()->components
5 K+ x( ~: ~$ z. E$ u/ S4 ~8 w - when(i->symbol && i->symbol->layer == "TOP"$ W% h# E/ {1 @4 W1 Y: P; \) N
- ;;get shape of placebound$ `. E q: g" R* x2 r4 @) S/ [
- plcbnd = car(setof(x i->symbol->children (x->objType == "shape" && index(x->layer "PACKAGE GEOMETRY/PLACE_BOUND_"))))
7 w8 j& j* Q' \5 \ - when(plcbnd6 A% X9 t* F; U# B# x! f
- ;;change to poly- W' ?4 ]1 O1 K3 k' z) Y
- area = car(axlPolyFromDB(plcbnd ?layer plcbnd->layer))->area4 |7 _& a' ~5 X
- ;;add
; {* p9 w: G% G" n- y - sumPlc = sumPlc + area0 h _3 b) v- P, Z
- )
- s$ U/ o/ t# L8 ~& g: W2 H% [ - )
+ z/ _8 k T$ e @& c) X: t - ), u' P: }: x, p5 }% |
-
$ S0 P3 v. h* u5 D) N - ;;calc area of outline6 N8 A& r* ]) C+ b% Z" W/ v+ K
- shapeOutline = axlDBGetShapes("BOARD GEOMETRY/OUTLINE") || axlDBGetShapes("BOARD GEOMETRY/DESIGN_OUTLINE")# }6 p! Z$ e6 u4 R
- sumOutline = car(axlPolyFromDB(car(shapeOutline) ?layer shapeOutline->layer))->area2 O. O& t: C$ u0 r0 ]) L
-
$ V: l" S" h! M9 ^8 n4 N, ` - ;;calc percentage3 ~9 _. ^3 w6 W0 L( Y; [8 q% N+ s
- result = sumPlc * 100.0 / sumOutline
3 D, l8 x% B3 @% @5 p - printf("Placebound Area = %.2f\nOutline Area = %.2f\nPercentage = %.2f%%\n" sumPlc sumOutline result)
" m. v9 G- H# F; r! T& c) [ - axlUIConfirm(sprintf(nil "Placebound Area = %.2f\nOutline Area = %.2f\nPercentage = %.2f%%\n" sumPlc sumOutline result))7 `" a0 @* T( h( J7 L" g' c
- ))
复制代码
( f# }4 V5 a$ t- W9 U% N
( {/ t8 k1 k) E! }. b( f+ t5 _ |
|