Đến nội dung


Hình ảnh
- - - - -

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


  • Please log in to reply
2 replies to this topic

#1 ngtthienan

ngtthienan

    biết zoom

  • Members
  • Pip
  • 13 Bài viết
Điểm đánh giá: 0 (bình thường)

Đã gửi 17 June 2014 - 08:08 PM

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" "" ))

  • 0

#2 phamthanhbinh

phamthanhbinh

    biết lệnh adcenter

  • Moderator
  • PipPipPipPipPipPipPip
  • 6009 Bài viết
Điểm đánh giá: 3113 (tuyệt vời)

Đã gửi 17 June 2014 - 09:18 PM

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ự.


  • 0
Chúc các quý Anh trên diễn đàn luôn khỏe, đẻ thêm được nhiều thứ để mót.

#3 ngtthienan

ngtthienan

    biết zoom

  • Members
  • Pip
  • 13 Bài viết
Điểm đánh giá: 0 (bình thường)

Đã gửi 18 June 2014 - 09:37 AM

Cám ơn nhiều.


  • 0