Đổi 1 số lệnh tắt và 1 số lệnh hay dùng NC tổng hợp vào 1 lisp!
Download here!
Ex:
1 - PLine
11- Xline
2 - Layiso
3 - Layoff
4- Layon
Q - Line
DD - Dimlinear
CG- Lấy layer nhanh
CD- Cắt dim
MAU - xác dịnh màu của nét
...
;;;======== MOT SO LENH AUTOCAD THAY DOI EDIT BY XUANNHAT CAD =========
PURGE
(defun c:2 () (command "LAYISO"))
(defun c:3 () (command "LAYOFF"))
(defun c:4 () (command "LAYON"))
(defun c:QE () (command "PURGE" "A" "*" "N"))
(defun c:AD () (command "AUDIT" "Y"))
(defun c:CV () (command "convert" "a" "a" ))
;******************************************************************************
(defun c:C () (ssget) (command "copy" "p" "" "m"))
(defun c:CC () (command "CIRCLE"))
(defun c:DE () (command "DIMCONTINUE"))
(defun c:DD () (command "DIMLINEAR"))
(defun c:DRR () (command "DIMDIAMETER"))
(defun c:DR () (command "DIMRADIUS"))
(defun c:DX () (command "DIMALIGNED"))
(defun c:DA () (command "DIMALIGNED"))
(defun c:DF () (command "DIMLFAC"))
(defun c:DRO () (command "DRAWORDER"))
(defun c:REG () (command "REGEN"))
(defun c:R () (command "ROTATE"))
(defun c:RE () (command "RECTANG"))
(defun c:TE () (command "TEXT"))
(defun c:Q () (command "LINE"))
(defun c:1 () (command "PLINE"))
(defun c:11 () (command "XLINE"))
(defun c:AS () (command "EXTEND"))
(defun c:AZ () (command "OFFSET"))
(defun c:tr () (command "trim"))
(defun c:tf () (ssget) (command "trim" "p" "" "f"))
;******************************************************************************
;ZOOM
(defun c:zz () (command "'.zoom" "p"))
(defun c:zw () (command "'.zoom" "w"))
(defun c:ze () (command "'.zoom" "e"))
(defun c:za () (command "'.zoom" "a"))
;******************************************************************************
;OSNAP
(defun c:oc () (command "osnap" "cen")(princ))
(defun c:oe () (command "osnap" "end")(princ))
(defun c:oi () (command "osnap" "int")(princ))
(defun c:or () (command "osnap" "per")(princ))
(defun c:on () (command "osnap" "near")(princ))
(defun c:oq () (command "osnap" "qua")(princ))
(defun c:om () (command "osnap" "mid")(princ))
;**************************************LENH CHUYEN DOI LAYER NHANH (CG)****************************************
(defun layset (/ LAY) (setvar "cmdecho" 0)
(setq LAY (entsel "\nChon doi tuong cho Layer hien hanh : "))
(if LAY (progn
(setq LAY (cdr (assoc 8 (entget (car LAY)))))
(command "_.layer" "set" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) )
(progn
(if (not ddlop) (load "ddlop")) (if (setq LAY (ddlop))
(progn
(command "_.LAYER" "ON" LAY "THAW" LAY "SET" LAY "") (princ (strcat "\nLayer : " LAY " da la hien hanh.")) ) ) ) )(princ) )
(defun c:CG () (layset))
;**************************************LENH CAT DIM (CD)****************************************
(DEFUN C:CD (/ CMD SS LTH DEM PT DS KDL N70 GOCX GOCY PT13 PT14 PTI PT13I PT14I
PT13N PT14N O13 O14 N13 N14 OSM OLDERR PT10 PT11)
(SETQ CMD (GETVAR "CMDECHO"))
(SETQ OSM (GETVAR "OSMODE"))
(SETQ OLDERR *error*
*error* myerror)
(PRINC "Please select dimension object!")
(SETQ SS (SSGET))
(SETVAR "CMDECHO" 0)
(SETQ PT (GETPOINT "Point to trim or extend:"))
(SETQ PT (TRANS PT 1 0))
(COMMAND "UCS" "W")
(SETQ LTH (SSLENGTH SS))
(SETQ DEM 0)
(WHILE (< DEM LTH)
(PROGN
(SETQ DS (ENTGET (SSNAME SS DEM)))
(SETQ KDL (CDR (ASSOC 0 DS)))
(IF (= "DIMENSION" KDL)
(PROGN
(SETQ PT10 (CDR (ASSOC 10 DS)))
(SETQ PT11 (CDR (ASSOC 11 DS)))
(SETQ PT13 (CDR (ASSOC 13 DS)))
(SETQ PT14 (CDR (ASSOC 14 DS)))
(SETQ N70 (CDR (ASSOC 70 DS)))
(IF (OR (= N70 32) (= N70 33) (= N70 160) (= N70 161))
(PROGN
(SETQ GOCY (ANGLE PT10 PT14))
(SETQ GOCX (+ GOCY (/ PI 2)))
)
)
(SETVAR "OSMODE" 0)
(SETQ PTI (POLAR PT GOCX 2))
(SETQ PT13I (POLAR PT13 GOCY 2))
(SETQ PT14I (POLAR PT14 GOCY 2))
(SETQ PT13N (INTERS PT PTI PT13 PT13I NIL))
(SETQ PT14N (INTERS PT PTI PT14 PT14I NIL))
(SETQ O13 (ASSOC 13 DS))
(SETQ O14 (ASSOC 14 DS))
(SETQ N13 (CONS 13 PT13N))
(SETQ N14 (CONS 14 PT14N))
(SETQ DS (SUBST N13 O13 DS))
(SETQ DS (SUBST N14 O14 DS))
(ENTMOD DS)
)
)
(SETQ DEM (+ DEM 1))
)
)
(COMMAND "UCS" "P")
(SETVAR "CMDECHO" CMD)
(SETVAR "OSMODE" OSM)
(setq *error* OLDERR) ; Restore old *error* handler
(PRINC)
)
;******************************************************************************
Nguyen Xuan Nhat - HAU - xuannhat2603@gmail.com
Nguyen Xuan Nhat - HAU - xuannhat2603@gmail.com
Nguyen Xuan Nhat - HAU - xuannhat2603@gmail.com
Không có nhận xét nào :
Đăng nhận xét