TA的每日心情 | 奋斗 2025-9-24 15:41 |
|---|
签到天数: 86 天 [LV.6]常住居民II
|
仅供参考- axlCmdRegister("csa" 'dbCheckSymbolArea)
5 y B" u# ?# a a) i - ( z5 E: K- L# i# K1 A
- ;; How to use8 m: c0 n, K( {5 s
- ;; skill load "test_calc.il"
9 x4 C/ |- @ b" ]7 A: \ - ;; csa7 y( t; \) W! c) u: y
- * f" M9 Q# z. M5 r+ J2 C
- procedure( dbCheckSymbolArea()% ?8 S/ W5 i( ^& v$ o: @
- let( (plcbnd area (sumPlc 0) shapeOutline sumOutline)
1 I4 M! M+ w3 C8 |6 P -
1 t4 ~( S" r- ~2 x" ]# |0 L - ;;calc area of placebound of top symbols9 V; b7 T7 [! l7 r
- foreach(i axlDBGetDesign()->components8 h- G$ A( b/ }8 Q, g8 d
- when(i->symbol && i->symbol->layer == "TOP"
+ o( q& G+ L5 G5 N' @% i6 I( \ - ;;get shape of placebound; _1 U2 G9 B9 T4 h9 `2 `# ^) T @
- plcbnd = car(setof(x i->symbol->children (x->objType == "shape" && index(x->layer "PACKAGE GEOMETRY/PLACE_BOUND_"))))- Z8 b- b; N) I; d1 |( H1 Q
- when(plcbnd
+ f ]* J6 k. g; c$ X - ;;change to poly
3 q' H4 |: x+ O' M - area = car(axlPolyFromDB(plcbnd ?layer plcbnd->layer))->area
" I5 a: `3 H% C7 p3 ]4 g( J - ;;add' d U# x# @% ?) P8 x/ m9 `. r# ~ E
- sumPlc = sumPlc + area
% N: Y1 J; X: q' f - )
! h% _! Z q) B( G, g* t5 [6 ~" { - )
3 B$ s$ @0 I/ j- d, x - )
d3 n3 T- t" X, U - 0 J' n% k1 x+ f: a/ G
- ;;calc area of outline7 \7 _8 ]4 V9 E
- shapeOutline = axlDBGetShapes("BOARD GEOMETRY/OUTLINE") || axlDBGetShapes("BOARD GEOMETRY/DESIGN_OUTLINE")& N8 i! x, H1 x7 J6 }
- sumOutline = car(axlPolyFromDB(car(shapeOutline) ?layer shapeOutline->layer))->area
1 `, K0 O0 i6 O" U4 q7 O - " n' u- i- N. c% y4 f. f6 P: K% Y9 O' o, Z
- ;;calc percentage, J/ M: }+ i" ` ]8 O/ q* Q
- result = sumPlc * 100.0 / sumOutline 9 V" F) D: o5 p9 h: R! c
- printf("Placebound Area = %.2f\nOutline Area = %.2f\nPercentage = %.2f%%\n" sumPlc sumOutline result)
* B5 E) g+ x3 m8 a2 { - axlUIConfirm(sprintf(nil "Placebound Area = %.2f\nOutline Area = %.2f\nPercentage = %.2f%%\n" sumPlc sumOutline result))
9 l1 Y$ ^% P/ C/ N0 k - ))
复制代码 : b/ M2 A, s4 w- C; B9 h6 u
, | X9 r7 O& z |
|