;****************113,建立圖層功能****************************
(defun C:tc()
       (command "layer" "new" "-HC" "S" "-hc" "c" "2" "");上蓋板

       (command "new" "-HH" "s" "-HH" "c" "21" "");上模座

       (command "new" "-BP" "s" "-BP" "c" "150" "");上墊板

       (command "new" "-PP" "s" "-PP" "c" "7" "");夾板
       (command "new" "-Pb" "s" "-Pb" "c" "2" "") 
    
       (command "new" "-B" "s" "-B" "c" "2" "");脫墊板

       (command "new" "-SP" "s" "-SP" "c" "3" "") ;脫板
       (command "new" "-Sb" "s" "-Sb" "c" "60" "") 
       (command "new" "-SP1" "s" "-SP1" "c" "1" "" )
       (command "new" "-SP2" "s" "-SP2" "c" "2" "" )

       (command "new" "-LP" "s" "-LP" "c" "2" "");導料板

       (command "new" "-D" "s" "-D" "c" "4" "");下模板
       (command "new" "-Db" "s" "-Db" "c" "40" "")
       (command "new" "-D1" "s" "-D1" "c" "1" "")
       (command "new" "-D2" "s" "-D2" "c" "2" "")  

       (command "new" "-CB" "s" "-CB" "c" "2" "");下墊板

       (command "new" "-DD" "s" "-DD" "c" "3" "");下模座       

       (command "new" "-A3" "s" "-A3" "c" "7" "");零件

       (command "new" "TEXT" "s" "TEXT" "c" "7" "") 

       (command "new" "LOUT" "s" "LOUT" "c" "8" "") ;料帶

       (command "new" "-HCDIM" "s" "-HCDIM" "c" "6" "")
       (command "new" "-HHDIM" "s" "-HHDIM" "c" "6" "")
       (command "new" "-BPDIM" "s" "-BPDIM" "c" "6" "")
       (command "new" "-PPDIM" "s" "-PPDIM" "c" "6" "")
       (command "new" "-BDIM" "s" "-BDIM" "c" "6" "")
       (command "new" "-SPDIM" "s" "-SPDIM" "c" "6" "") 
       (command "new" "-SP1DIM" "s" "-SP1DIM" "c" "6" "") 
       (command "new" "-SP2DIM" "s" "-SP2DIM" "c" "6" "") 
       (command "new" "-LPDIM" "s" "-LPDIM" "c" "6" "")
       (command "new" "-DDIM" "s" "-DDIM" "c" "6" "")
       (command "new" "-D1DIM" "s" "-D1DIM" "c" "6" "")
       (command "new" "-D2DIM" "s" "-D2DIM" "c" "6" "")
       (command "new" "-CBDIM" "s" "-CBDIM" "c" "6" "")
       (command "new" "-DDDIM" "s" "-DDDIM" "c" "6" "")
       (command "new" "-A3DIM" "s" "-A3DIM" "c" "6" "")
       (command "new" "DIM" "s" "DIM" "c" "6" "")

       
       (command "new" "1" "s" "1" "c" "1" "")
       (command "new" "2" "s" "2" "c" "2" "")
       (command "new" "3" "s" "3" "c" "3" "")
       (command "new" "4" "s" "4" "c" "4" "")
       (command "new" "5" "s" "5" "c" "5" "")
       (command "new" "6" "s" "6" "c" "6" "")
       (command "new" "7" "s" "7" "c" "7" "" ))


(defun C:TA()(command "layer" "unlock" "*" "ON" "*" "t" "*" "f" 
"-hcdim,-hhdim,-bpdim,-ppdim,-bdim,-spdim,-sp1dim,-sp2dim,-lpdim,-ddim,-d1dim,-d2dim,-cbdim,-dddim" "s" "-d" ""))
                
       

(defun C:TAA()(command "LAYER" "unlock" "*" "ON" "*" "t" "*" ""))

(defun c:up()(command "-layer" "on" "*" "u" "*" "t" "*" "s" "-hc" "f" "*" "t" 
"-HC,-HH,-BP,-PP,-B,-SP,-SP1,-SP2,-PB,-SB,lout,MM,GG,WIR,mark" ""))

(defun c:do()(command "-layer" "on" "*" "u" "*" "t" "*" "s" "-d" "f" "*" "t" 
"-lp,-d,-db,-d1,-d2,-cb,-dd,lout,MM,GG,WIR,mark" ""))

;***************7,分模功能******************************
(defun c:FM()
    (command "layer" "LO" "*" "")
    (command "layer" "U" "-HC" "U" "-HCDIM" "") 
    (command "copy" "ALL" "" "0,0" "1000,5000")

    (command "layer" "U" "-HH" "U" "-HHDIM" "LO" "-HC" "LO" "-HCDIM" "") 
    (command "copy" "ALL" "" "0,0" "1000,4500")

    (command "layer" "U" "-BP" "U" "-BPDIM" "LO" "-HH" "LO" "-HHDIM" "")
    (command "copy" "ALL" "" "0,0" "1000,4000")

    (command "layer" "U" "-PP" "U" "-PPDIM" "LO" "-BP" "LO" "-BPDIM" "") 
    (command "copy" "ALL" "" "0,0" "1000,3500")

    (command "layer" "U" "-B" "U" "-BDIM" "LO" "-PP" "LO" "-PPDIM" "") 
    (command "copy" "ALL" "" "0,0" "1000,3000")

    (command "layer" "U" "-SP" "U" "-SPDIM" "LO" "-B" "LO" "-BDIM" "") 
    (command "copy" "ALL" "" "0,0" "1000,2500")

    (command "layer" "U" "-SP1" "U" "-SP1DIM" "LO" "-SP" "LO" "-SPDIM" "") 
    (command "copy" "ALL" "" "0,0" "0,2500")

    (command "layer" "U" "-SP2" "U" "-SP2DIM" "LO" "-SP1" "LO" "-SP1DIM" "") 
    (command "copy" "ALL" "" "0,0" "2000,2500")

    (command "layer" "U" "-D" "U" "-DDIM" "LO" "-SP2" "LO" "-SP2DIM" "") 
    (command "copy" "ALL" "" "0,0" "1000,1500")

    (command "layer" "U" "-D1" "U" "-D1DIM" "LO" "-D" "LO" "-DDIM" "")
    (command "copy" "ALL" "" "0,0" "2000,1500")
     
    (command "layer" "U" "-LP" "U" "-LPDIM" "LO" "-D1" "LO" "-D1DIM" "")
    (command "copy" "ALL" "" "0,0" "0,1500")

    (command "layer" "U" "-CB" "U" "-CBDIM" "LO" "-LP" "LO" "-LPDIM" "") 
    (command "copy" "ALL" "" "0,0" "1000,1000")

    (command "layer" "U" "-DD" "U" "-DDDIM" "LO" "-CB" "LO" "-CBDIM" "")
    (command "copy" "ALL" "" "0,0" "1000,500")
    (command "layer" "U" "*" "") 
)


;***************,圖層RENAM功能******************************
(defun c:BM(/ a)
    (command "E" "LA" "LP" "-DD")
    (command "RENAME" "LA" "LB" "-CB")
    (command "RENAME" "LA" "DIE" "-D")
    (command "RENAME" "LA" "DIE_O" "-D_O")
    (command "RENAME" "LA" "PS" "-SP")
    (command "RENAME" "LA" "PS_O" "-SP_O")
    (command "RENAME" "LA" "PPS" "-B")
    (command "RENAME" "LA" "PH" "-PP")
    (command "RENAME" "LA" "UB" "-BP")
    (command "RENAME" "LA" "UP" "-HH")
    (command "RENAME" "LA" "COVER" "-HC")
    (command "RENAME" "LA" "LP_WM" "-DDDIM")
    (command "RENAME" "LA" "LB_WM" "-CBDIM")
    (command "RENAME" "LA" "DIE_WM" "-DDIM")
    (command "RENAME" "LA" "PS_WM" "-SPDIM")
    (command "RENAME" "LA" "PPS_WM" "-BDIM")
    (command "RENAME" "LA" "PH_WM" "-PPDIM")
    (command "RENAME" "LA" "UB_WM" "-BPDIM")
    (command "RENAME" "LA" "UP_WM" "-HHDIM")
    (command "RENAME" "LA" "COVER_WM" "-HCDIM"))
                              
(defun c:MB(/ a)
    (command "RENAME" "LA" "-DD" "LP")
    (command "RENAME" "LA" "-CB" "LB")
    (command "RENAME" "LA" "-D" "DIE")
    (command "RENAME" "LA" "-D_O" "DIE_O")
    (command "RENAME" "LA" "-SP" "PS")
    (command "RENAME" "LA" "-SP_O" "PS_O")
    (command "RENAME" "LA" "-B" "PPS")
    (command "RENAME" "LA" "-PP" "PH")
    (command "RENAME" "LA" "-BP" "UB")
    (command "RENAME" "LA" "-HH" "UP")
    (command "RENAME" "LA" "-HC" "COVER")
    (command "RENAME" "LA" "-DDDIM" "LP_WM")
    (command "RENAME" "LA" "-CBDIM" "LB_WM")
    (command "RENAME" "LA" "-DDIM" "DIE_WM")
    (command "RENAME" "LA" "-SPDIM" "PS_WM")
    (command "RENAME" "LA" "-BDIM" "PPS_WM")
    (command "RENAME" "LA" "-PPDIM" "PH_WM")
    (command "RENAME" "LA" "-BPDIM" "UB_WM")
    (command "RENAME" "LA" "-HHDIM" "UP_WM")
    (command "RENAME" "LA" "-HCDIM" "COVER_WM"))                              
