TA的每日心情 | 奋斗 2025-7-7 15:38 |
---|
签到天数: 83 天 [LV.6]常住居民II
|
仅供参考- axlCmdRegister("csa" 'dbCheckSymbolArea)
- T* N9 p+ t# U) }% v/ \5 g
* j% q/ R( x2 a( d! {- ;; How to use- u D# \4 ^! f2 M0 @5 N0 l' |( t
- ;; skill load "test_calc.il"
2 f3 Y; A1 \: t. ?: C - ;; csa; y) c# Z- ]% ^" w
' W9 S0 }/ F& O* i8 L- procedure( dbCheckSymbolArea()$ o3 }# G! W- _; o( r2 I n
- let( (plcbnd area (sumPlc 0) shapeOutline sumOutline)& W4 P9 c1 z2 P: G
- 0 b- k; H0 o7 N, o/ s$ `
- ;;calc area of placebound of top symbols( G j0 B9 ?3 o) w0 ?5 P: l
- foreach(i axlDBGetDesign()->components
q8 c2 T2 j! \( n - when(i->symbol && i->symbol->layer == "TOP"* I9 Z$ e# Y- x* G3 L ^
- ;;get shape of placebound
0 c6 @1 u- W6 o6 `/ N; s - plcbnd = car(setof(x i->symbol->children (x->objType == "shape" && index(x->layer "PACKAGE GEOMETRY/PLACE_BOUND_"))))
2 L( F3 K+ d8 _% P$ Y% C - when(plcbnd
( S; R2 R2 d" Q* e - ;;change to poly+ s! y2 o7 f" w) T
- area = car(axlPolyFromDB(plcbnd ?layer plcbnd->layer))->area2 R# w! B' z* x, L0 E- Q
- ;;add
, B# H1 E6 O+ X$ Y$ D( ^3 U - sumPlc = sumPlc + area
2 T& W( a9 K! [# O. H; O4 ` - )
5 f$ J( M, a: ^ - )
% ~2 J5 O' t! R# P1 V; m - )
* {3 j9 q9 j1 e" D8 `$ s - : s7 J2 D' Y2 n1 ]
- ;;calc area of outline5 Z x' s; \2 z D
- shapeOutline = axlDBGetShapes("BOARD GEOMETRY/OUTLINE") || axlDBGetShapes("BOARD GEOMETRY/DESIGN_OUTLINE")
, \: @( G2 V( @/ ` - sumOutline = car(axlPolyFromDB(car(shapeOutline) ?layer shapeOutline->layer))->area& I9 h* |6 L+ O1 a+ |
-
( w& L1 P; u. C ~4 R1 K ?- j- K) x - ;;calc percentage9 V- S& a" M* c7 x7 V) O4 |6 k
- result = sumPlc * 100.0 / sumOutline
% s! o1 T( C! z5 e5 |9 L4 P& k8 N - printf("Placebound Area = %.2f\nOutline Area = %.2f\nPercentage = %.2f%%\n" sumPlc sumOutline result)
9 S, A9 r( ^* l0 l- s; ^: i c - axlUIConfirm(sprintf(nil "Placebound Area = %.2f\nOutline Area = %.2f\nPercentage = %.2f%%\n" sumPlc sumOutline result)) R4 k2 T5 I4 [3 [; d/ q% r
- ))
复制代码 # E. D- w0 T: D7 ~. s" V
. F4 F5 ]5 {. \, H+ ?! O5 M3 ?, H# i |
|