Chuyển đến nội dung
Diễn đàn CADViet
Đăng nhập để thực hiện theo  
ngtthienan

Nhờ nối 2 lisp load linetype và tạo layer

Các bài được khuyến nghị

Mình muốn làm 1 lisp tạo layer trong đó có load linetype tự tạo. Thường thì đầu tiên phải load linetype, sau mới tạo được layer. Nhờ anh cao thử nào nối 2 đọn lisp thành 1 lệnh command thì tạo được cả 2 luôn.

 

(defun c:llt ()

(if (tblsearch "ltype" "acadISO.lin")

(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")

(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "")))

 

(defun c:createlayer ()

                (command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")

                (command "regenauto" "off")

                (command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )

                (command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )

                (command "layer" "lt" "HIDDEN-TA" "ACP HIDDEN" "lw" "0.0" "ACP HIDDEN" "c" 8 "ACP HIDDEN" "" ))

 

Cám ơn rất nhiều

 

(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
 
(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
 
(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
 
(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
 
(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
(command "layer" "lt" "HIDDEN-TA" "ACP HIDDEN" "lw" "0.0" "ACP HIDDEN" "c" 8 "ACP HIDDEN" "" ))
(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
(command "layer" "lt" "HIDDEN-TA" "ACP HIDDEN" "lw" "0.0" "ACP HIDDEN" "c" 8 "ACP HIDDEN" "" ))

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác

 

Mình muốn làm 1 lisp tạo layer trong đó có load linetype tự tạo. Thường thì đầu tiên phải load linetype, sau mới tạo được layer. Nhờ anh cao thử nào nối 2 đọn lisp thành 1 lệnh command thì tạo được cả 2 luôn.

 

(defun c:llt ()

(if (tblsearch "ltype" "acadISO.lin")

(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")

(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "")))

 

(defun c:createlayer ()

                (command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")

                (command "regenauto" "off")

                (command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )

                (command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )

                (command "layer" "lt" "HIDDEN-TA" "ACP HIDDEN" "lw" "0.0" "ACP HIDDEN" "c" 8 "ACP HIDDEN" "" ))

 

Cám ơn rất nhiều

 

(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
 
(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
 
(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
 
(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
 
(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
(command "layer" "lt" "HIDDEN-TA" "ACP HIDDEN" "lw" "0.0" "ACP HIDDEN" "c" 8 "ACP HIDDEN" "" ))
(defun c:llt ()
(if (tblsearch "ltype" "acadISO.lin")
(command "linetype" "load" "acad.lin" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" "y")
(command "linetype" "load" "HIDDEN-TA" "C:\\Users\\Administrator\\AppData\\Roaming\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support\\acadiso.lin" ""))
)
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
(defun c:createlayer ()
(command "layer" "n" "ACCESORIES" "n" "ACP ELEV" "n" "ACP HIDDEN" "")
  (command "regenauto" "off")
(command "layer" "lw" "0.0" "ACCESORIES" "c" 30 "ACCESORIES" "" )
(command "layer" "lw" "0.0" "ACP ELEV" "c" 1 "ACP ELEV" "" )
(command "layer" "lt" "HIDDEN-TA" "ACP HIDDEN" "lw" "0.0" "ACP HIDDEN" "c" 8 "ACP HIDDEN" "" ))

Hề hề hề,

Bạn thử tự làm coi sao nhé.

1/- Xóa bỏ một dấu ngoặc đóng cuối cùng của đoạn code thứ nhất.

2/- Xóa bỏ dòng code: (defun c:createlayer () 

của đoạn code thứ hai

3/- Nối hai đoạn code này lại theo thứ tự.

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác

Tạo một tài khoản hoặc đăng nhập để nhận xét

Bạn cần phải là một thành viên để lại một bình luận

Tạo tài khoản

Đăng ký một tài khoản mới trong cộng đồng của chúng tôi. Điều đó dễ mà.

Đăng ký tài khoản mới

Đăng nhập

Bạn có sẵn sàng để tạo một tài khoản ? Đăng nhập tại đây.

Đăng nhập ngay

Đăng nhập để thực hiện theo  

×