|
(putd (quote prg_autoSpliting) nil)
- H# ?/ u; m- W1 y5 B& J(putd (quote prg_autoSplitingform) nil)
" n# J/ D2 {3 {% [(putd (quote autoSpliting_callback) nil)
, \& {& r1 X1 {' `(axlShell "done")
k6 |- v1 t- ?, R3 r- e(axlCmdRegister "fn_autoSpliting" (_backquote prg_autoSpliting) ?cmdType "general")
- n# R$ H4 P+ ?0 o2 I* l(setq film (axlGetParam "paramLayerGroup:etch"))( }9 m, [$ y) V2 |5 m, l9 z$ A1 J
(setq film (getq film groupMembers)) . N" \ R/ O* S3 J5 y0 i
(setq LayerCnt (length (axlSubclassRoute))) 3 T, Z( w0 \( F; S6 A
(setq negFilm (quote nil))
& j% h. a$ w' i(foreach film_e film (setq temp (strcat "ETCH/" film_e))
+ t2 m/ q; z3 o1 L(if (equal (axlIsLayerNegative temp) t) then (setq negFilm (cons film_e negFilm))))
7 M% \8 Z# _7 c. o3 |(setq negFilm (reverse negFilm)) 1 y, u1 `! v+ b6 r0 J) L; r1 i, g
(defun prg_autoSpliting nil (if (nequal (isFile "d:/script/I.bmp") t)
- \- _3 r" U% N2 P& V+ P then (renameFile "d:/script/Inventec" "d:/script/I.bmp"))
8 _% T) @; C9 l c0 } (prg_autoSplitingform) (setq disp_autoSplitingform (axlFormCreate (gensym) "d:/script/autoSpliting.form" (_backquote ("e" "outer")) (_backquote autoSpliting_callback) t)) 7 ?5 R h& A4 @) \. W
(axlFormDisplay disp_autoSplitingform) . u3 i* s, K+ E; r1 [
(axlFormSetFieldEditable disp_autoSplitingform "create" nil)
6 o- N* J7 F3 ^: g (deleteFile "d:/script/autoSpliting.form") " m$ }. C9 ~% I4 T( g% f
(renameFile "d:/script/Inventec.bmp" "d:/script/Inventec")) 1 c$ k8 o2 T: ^2 f9 g$ J
(defun autoSpliting_callback (disp_autoSplitingform) (case (getq disp_autoSplitingform curField) ("negLayer" (if (getq disp_autoSplitingform curValue) then (axlFormSetFieldEditable disp_autoSplitingform "create" t))) ("cancel" (axlFormClose disp_autoSplitingform)
4 o; C8 E( ~/ e (axlVisibleSet layerActive) / d! e/ X) ^. d; O4 o& ^& J4 s
(axlWindowBoxSet windowBox) % I4 e ~2 V5 T$ B$ p3 H- ~' B
(axlUIWRedraw nil)) ("create" (setq layerActive (axlVisibleGet)) (setq windowBox (axlWindowBoxGet)) " {+ r t5 ^% m3 u
(axlVisibleDesign nil) (setq negLayer (axlFormGetField disp_autoSplitingform "negLayer")) : c" u3 ^; j0 @! h6 V: U) T" Q# F
(axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) (setq temp (strcat "ETCH/" negLayer)) + g% h' j4 @5 f9 K
(axlVisibleLayer temp t) ! }4 E/ U5 d* m
(axlAddSelectAll) (setq sel (axlGetSelSet))
! Y# S' k6 S; U. ]3 Z (axlClearSelSet) (setq old_shape_num (length sel)) (setq shape_old (quote nil)) (setq shape_oldAll (quote nil)) (foreach sel_e sel (setq sel_en (getq sel_e net)) (setq sel_en (getq sel_en name)) (if (nequal sel_en "") then (setq sel_el (length (getq sel_e connect))) (setq sel_eb (getq sel_e bBox)) (setq temp (getq sel_e connect)) (setq sel_ec (quote nil)) (foreach temp_e temp (setq sel_ec (cons (getq temp_e xy) sel_ec))) (setq shape_old (cons sel_ec shape_old)) (setq shape_old (cons sel_eb shape_old)) (setq shape_old (cons sel_el shape_old)) (setq shape_old (cons sel_en shape_old)) (setq shape_oldAll (cons shape_old shape_oldAll)))) U" W! _% L6 S5 |) [) a
(axlVisibleDesign nil)
/ G& d5 A- }9 L: G1 g (axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) (setq temp (strcat "BOUNDARY/" negLayer))
$ g2 a! r# \' M (axlVisibleLayer temp t) 8 m G6 p7 z( _* z
(axlAddSelectAll) (setq sel (axlGetSelSet)) ' s2 I5 v) @* Y- Y- q
(axlDeleteObject sel) (setq temp (strcat "ETCH/" negLayer)) o0 f: Y2 ]/ ~; P$ L5 B
(axlVisibleLayer temp t) 9 D$ Q" W" K- z: M/ o& _& d/ g6 N
(axlAddSelectAll) (setq sel (axlGetSelSet)) 0 { V' e2 \6 a+ B$ Y9 K f' w, R5 d
(axlDeleteObject sel) 9 K' A( _; ?$ E/ a6 i7 e9 ?( V
(axlVisibleDesign nil)
) J9 P/ S% C7 J (axlVisibleLayer "ROUTE KEEPIN" t) 7 r$ s) T1 V ^9 ~( P* A
(axlAddSelectAll) (setq sel (nth 0 (axlGetSelSet))) # l4 v1 v2 u4 c% ?- u; U" c+ K% g- k$ {
(axlClearSelSet) (setq sel_shape (axlPolyFromDB sel))
) T. O: \6 l9 R @ (axlVisibleDesign nil)
! ?4 ~, |( K2 t# T/ z (axlSetFindFilter ?enabled (list "noall" "Shapes" "Lines") ?onButtons (list "noall" "Shapes" "Lines")) * C' r* h6 F" Z$ U% J/ E) J
(axlVisibleLayer "ANTI ETCH/ALL" t) (setq temp (strcat "ANTI ETCH/" negLayer))
3 w( [6 S2 X# u (axlVisibleLayer temp t) ( x, a7 B' T3 g1 J
(axlAddSelectAll) (setq sel_anti (axlGetSelSet)) 7 d+ V: S2 |7 ?2 E1 u
(axlClearSelSet) (setq sel_antiEtch nil) (foreach sel_anti_e sel_anti (setq antiElmPoly (axlPolyFromDB sel_anti_e ?endCapType (quote ROUND))) (setq sel_antiEtch (append antiElmPoly sel_antiEtch))) (setq splitPolyList (axlPolyOperation sel_shape sel_antiEtch (quote ANDNOT))) (if splitPolyList then (setq temp (strcat "BOUNDARY/" negLayer)) (foreach resPoly splitPolyList (axlDBCreateShape resPoly t temp nil nil)) else ((axlMsgPut list (axlPolyErrorGet))))
9 f ^# l8 Z, ?6 v- y2 F# H( h+ q/ | (axlClearSelSet) . A) k1 J( o9 k2 ~$ ^
(axlVisibleDesign nil)
! ^! R. }7 H4 x (axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) (setq temp (strcat "BOUNDARY/" negLayer)) (axlVisibleLayer temp t)
b( u, n( m, t6 w2 X# } (axlAddSelectAll) (setq sel (axlGetSelSet)) (setq new_shape_num (length sel)) (foreach sel_e sel (foreach shape_oldAll_e shape_oldAll (setq flag 0) (setq shape_oldAll_en (nth 0 shape_oldAll_e)) (setq shape_oldAll_ec (nth 3 shape_oldAll_e)) (setq flag_i 0) (setq flag_o 0) (foreach shape_oldAll_ece shape_oldAll_ec (if (equal (axlGeoPointInShape shape_oldAll_ece sel_e) t) then (postincrement flag_i) else (postincrement flag_o))) (if (greaterp flag_i flag_o) then (axlDBAssignNet sel_e shape_oldAll_en t)))) / a' j6 @* ~* r/ @$ J3 ?
(axlDBRefreshId nil)
0 p F& b0 s: G& K9 z. L9 _ (axlClearSelSet)
0 A- e, z: ^9 r (axlVisibleDesign nil)
2 m9 T- Y- O% h (axlSetFindFilter ?enabled (list "noall" "Shapes") ?onButtons (list "noall" "Shapes")) ) P, D3 o6 L, [8 }2 ?
(setq temp (strcat "ETCH/" negLayer)) ; @4 H' L! [8 i1 i% S( Z, r
(axlVisibleLayer temp t)
/ a# I$ N- y( W; f: K$ R3 E (axlAddSelectAll) (setq sel (axlGetSelSet)) (setq new_shape_num (length sel)) (setq shape_new (quote nil)) (setq shape_newAll (quote nil)) (setq flag_dummyShape 0) (foreach sel_e sel (setq sel_en (getq sel_e net)) (setq sel_en (getq sel_en name)) (if (nequal sel_en "") then (setq sel_el (length (getq sel_e connect))) (setq sel_eb (getq sel_e bBox)) (setq temp (getq sel_e connect)) (setq sel_ec (quote nil)) (foreach temp_e temp (setq sel_ec (cons (getq temp_e xy) sel_ec))) (setq shape_new (cons sel_ec shape_new)) (setq shape_new (cons sel_eb shape_new)) (setq shape_new (cons sel_el shape_new)) (setq shape_new (cons sel_en shape_new)) (setq shape_newAll (cons shape_new shape_newAll)) else (postincrement flag_dummyShape) (axlHighlightObject (getq sel_e net) t))) (setq dir (getWorkingDir)) (setq dir (strcat dir "\\log")) (createDir dir) (setq dir (strcat dir "\\autoSpliting.txt")) (setq report (outfile dir)) (setq i 0) (foreach shape_newAll_e shape_newAll (postincrement i) (fprintf report "#%2d shape is assigned to net \"%s\"\n" i (nth 0 shape_newAll_e))) (foreach shape_newAll_e shape_newAll (foreach shape_oldAll_e shape_oldAll (if (and (equal (nth 0 shape_newAll_e) (nth 0 shape_oldAll_e)) (equal (nth 1 shape_newAll_e) (nth 1 shape_oldAll_e))) then (setq shape_newAll (remove shape_newAll_e shape_newAll)) (setq shape_oldAll (remove shape_oldAll_e shape_oldAll))))) (fprintf report "\nSummary:\n\n") (fprintf report "Total shape(s) before: %d\n" old_shape_num) (fprintf report "Total shape(s) after : %d\n" new_shape_num) (fprintf report "\n") (fprintf report "Total dummy shape(s) : %d\n" flag_dummyShape) (fprintf report "\n") (if (nequal shape_newAll nil) then (foreach shape_newAll_e shape_newAll (fprintf report "Via quantity is changed in a %s shape. \n" (nth 0 shape_newAll_e)) (foreach sel_e sel (setq sel_en (getq sel_e net)) (if (equal (getq sel_en name) (nth 0 shape_newAll_e)) then (axlHighlightObject (getq sel_en net) t))))) (fprintf report "\nNote: Please check each highlighted shape after running this program.\n") (close report)
|7 g; K* Z* A! `9 ~ (axlClearSelSet)
* D* x% q; e! B4 Q, t6 N5 X (axlVisibleSet layerActive) / U0 v7 e. p4 T/ { s3 _
(axlWindowBoxSet windowBox) # A) X7 e' u' A! {* r
(axlUIWRedraw nil) % B/ v* k8 A' e4 A) n
(axlUIViewFileCreate "./log/autoSpliting.txt" "Auto-generated Shape Status" nil))))
4 D; \" r, q5 m( [. K9 \ (defun prg_autoSplitingform nil (setq report (outfile "d:/script/autoSpliting.form"))
4 p& E5 j8 |! w; s (fprintf report "FILE_TYPE=FORM_DEFN VERSION=2 \n")
Y2 [0 @! B) E4 ^ (fprintf report "FORM \n")
! i& M2 Z2 x* @! F1 p4 K (fprintf report "FIXED \n") " v; K+ ?# `, B
(fprintf report "PORT 44 20 \n")
2 j/ p7 v+ \! H' m5 k (fprintf report "HEADER \"Plane Auto-Spliting Utility\" \n")
2 H: O/ y( a3 R# u/ V (if (geqp (length negFilm) 2) & Q% Y" m; Y$ F
then (fprintf report "POPUP <negLayer>")
" E. O4 G- s- p. T' t6 q G" @ W& Y (setq i 0)
" e$ `( G( R1 ? (foreach negFilm_e negFilm (fprintf report "\"%s\" \"%s\"" negFilm_e negFilm_e) * K1 E" O0 L0 {0 e( ] h: r/ u- e" N! _/ p
(postincrement i) (if (equal i (length negFilm)) then (fprintf report ". ") else (fprintf report ", ")))) % x8 _1 @ B; E2 o3 d, B2 H7 I* L9 b
(fprintf report " \n")
5 X# T2 ~# A' a' u8 Q! r: e (fprintf report "TILE \n")
& t+ B: [/ s- [8 P. R (fprintf report "FLOC 30 14 \n")
1 E7 b( t- R1 G1 v (fprintf report "FSIZE 14 2 \n") : ^6 z( }4 q8 i0 F- L. z5 @
(fprintf report "ENDFIELD \n")
0 v- P3 t: {1 p, d/ H4 v& T$ ]1 d (fprintf report "TEXT \"Select layer for split plane creation:\" \n")
$ B: X) n2 X: X7 q; d (fprintf report "FLOC 1 1 \n") 2 J( P5 N: h0 U1 g4 ^- _/ v" V; X
(fprintf report "ENDTEXT \n") 2 N/ U. M' Q; J. U; u
(fprintf report "TEXT \"Layer will have all shapes an thermal reliefs re-built.\" \n") 5 j! G' t" E/ L7 `! W
(fprintf report "FLOC 6 6 \n")
" _8 V+ f( L! \/ v1 }. d (fprintf report "ENDTEXT \n")
& x- [7 U/ e8 f (fprintf report "FIELD create \n") " l8 n! d( q5 Q# @! k' t' ^
(fprintf report "FLOC 3 14 \n") # F2 e; G% ~1 O
(fprintf report "MENUBUTTON \"Create\" 12 3 \n")
' y/ ]6 A: U! _$ B3 J: y: t* x/ r (fprintf report "ENDFIELD \n") N, J$ {" D6 f' r& w2 b6 G- |
(fprintf report "FIELD cancel \n") ; l/ n" R" i8 C7 r# c' c. r b' s
(fprintf report "FLOC 17 14 \n") " T% F: ]/ H4 f& ~6 t
(fprintf report "MENUBUTTON \"Close\" 12 3 \n")
; G! z" W# I) K1 a (fprintf report "ENDFIELD \n")
6 ?) `! L0 H1 o/ I" A/ { (if (geqp (length negFilm) 2)
; s0 Y7 A& [3 e0 A) N. X then
4 Z' _* d1 N; D A* o( C (fprintf report "FIELD negLayer \n") o: S4 L9 V$ D8 t! m3 h3 |
(fprintf report "FLOC 10 3 \n") % M6 V+ t8 \ Q% S. i a0 ~
(fprintf report "ENUMSET 8 \n") + O/ q+ R! x3 l9 ^
(fprintf report "STRFILLIN 15 15 \n") ; w( Z* D9 P5 q
(fprintf report "POP \"negLayer\" \n")
5 C2 p9 Q2 R7 P0 E (fprintf report "ENDFIELD \n"))
% `. w) b. }4 g0 g6 F (fprintf report "ENDTILE \n") ; |$ z2 M" {* ~0 }
(fprintf report "ENDFORM \n")
! A! e/ U4 D8 } (fprintf report " \n")
, V, c' u o V$ B (close report)) |
|