Chuyển đến nội dung
Diễn đàn CADViet
be_chanh

Ứng dụng LISP để vẽ bản vẽ kiến trúc (phần cơ bản)

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

Gửi anh em lại lisp LJ mình thử chạy tốt:

 

 

;;; =================== LINE TO PLINE ( LJ ) =====================

 

(DEFUN INIT ()

(setq Blm (getvar "BLIPMODE")

Cmd (getvar "CMDECHO")

Os (getvar "OSMODE")

Olderr *ERROR*

) ;setq

(setvar "BLIPMODE" 0)

(setvar "CMDECHO" 0)

(defun *ERROR* (Msg)

(princ "\n:")

(Princ Msg)

(setvar "blipmode" Blm)

(setvar "CMDECHO" Cmd)

(setvar "OSMODE" Os)

(setq *ERROR* Olderr)

(princ)

)) ;init

(DEFUN REINIT ()

(setvar "blipmode" Blm)

(setvar "CMDECHO" Cmd)

(setvar "OSMODE" Os)

(setq *ERROR* Olderr)

(princ)

) ;reinit

(defun c:LJ (/ name1 ent A b sget)

(init)

(setq name1 (car (entsel))

sget (ssget)

ent (cdr (assoc 0 (setq A (entget name1))))

)

(if

(or (= "LINE" ent)

(= "ARC" ent))

(command "pedit" name1 "y" "j" sget "" "")

(command "pedit" name1 "j" sget "" ""))

(reinit)

(princ)

)

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

lệnh vẽ cửa đi thì ok rồi

còn vẽ cửa sổ vẫn chưa hiểu lam

làm mãi ko được

ban nào rỗi chi mình với

thao tác đầy đủ nhé

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

@J: lệnh oo vẽ line, thử chơi line chéo đi :D tịt rồi J. Line thẳng ok.

Ý bác đang nói đến lisp nào đấy ạ ^^ OO có phải lisp offset sang 2 bên ??

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

oạch. có bài này mà lại về chuyên kiến trúc nữa chứ. hic. tối về update ngay. thanks các anh rất nhiều :ph34r:

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

Nhanh quá! Cái lisp NN kia giúp tôi đỡ được bao nhiêu công khi phải BO line thanh PLINE.

 

Giờ đến vễ cửa, cửa đi, cửa sổ... nhiều quá. Copy từ thư viện ra thì lại phải SCALE rồi làng nhằng LAYER không đúng với bản vẽ của mình ! Vậy thì co cách nào không nhỉ?

 

Bài 5: Vẽ cửa đi

 

;-------------------------------------------------------------------------------------
;ve cua di 1 canh
;-------------------------------------------------------------------------------------
(defun c:c1 (/ p1 p2 p3 p4 p5 daicua x y)
(setq osm (getvar "osmode"))  
(setq	p1     (getpoint "\nHay vao diem goc cua: ")

p2     (getpoint p1 "\nHay vao diem mut cua: ")
p3     (getpoint p1 "\nHay vao huong cua: ")
daicua (distance p1 p2)
x      (car p1)
y      (car (cdr p1))
x      25
y      daicua
p4     (list x y)
p5     (list daicua 0)
 )
 (setvar "OSMODE" 0)
 (if (l3d_khongthanghang p1 p2 p3)
   (progn
     (command ".UCS" "3" p1 p2 p3)
     (command ".rectangle" "0,0" p4)
     (command ".Arc" p5 "C" "0,0" p4)
     (command ".UCS" "P")
   )
   (princ "\n3 diem nhap vao khong duoc thang hang")
 )
(setvar "osmode" osm)       
)
;-------------------------------------------------------------------------------------
;ve cua di 2 canh
;-------------------------------------------------------------------------------------
(defun c:c2 (/ p1 p2 p3 p4 p5 daicua x y)
 (setq osm (getvar "osmode"))  
 (setq	p1     (getpoint "\nHay vao diem goc cua: ")
p2     (getpoint p1 "\nHay vao diem mut cua: ")
p3     (getpoint p1 "\nHay vao huong cua: ")
daicua (/ (distance p1 p2) 2.0)
x      (car p1)
y      (car (cdr p1))
x      25
y      daicua 
p4     (list x y)
p5     (list daicua 0)
 )
 (setvar "OSMODE" 0)
 (if (l3d_khongthanghang p1 p2 p3)
   (progn
     (command ".UCS" "3" p1 p2 p3)
     (command ".rectangle" "0,0" p4)
     (command ".Arc" p5 "C" "0,0" p4)
     (command ".UCS" "P")

     (command ".UCS" "3" p2 p1 p3)
     (command ".rectangle" "0,0" p4)
     (command ".Arc" p5 "C" "0,0" p4)
     (command ".UCS" "P")

   )

   (princ "\n3 diem nhap vao khong duoc thang hang")
 )
 (setvar "osmode" osm)       
)
;-------------------------------------------------------------------------------------
;ve cua di 4 canh
;-------------------------------------------------------------------------------------
(defun c:c4 (/ p1 p2 p3 p4 p5 daicua x y)
 (setq osm (getvar "osmode"))    
 (setq	p1     (getpoint "\nHay vao diem goc cua: ")
p2     (getpoint p1 "\nHay vao diem mut cua: ")
p3     (getpoint p1 "\nHay vao huong cua: ")
daicua (/ (distance p1 p2) 4.0)
x      (car p1)
y      (car (cdr p1))
x      25
y      daicua 
p4     (list x y)
p5     (list daicua 0)
 )
 (setvar "OSMODE" 0)
 (if (l3d_khongthanghang p1 p2 p3)
   (progn

     (setq diem1 (diemgiua p1 (diemgiua p1 p2)))
     (setq diem2 (diemgiua p1 p2))
     (setq diem3 (diemgiua p2 (diemgiua p1 p2)))      

     (command ".UCS" "3" p1 p2 p3)
     (command ".rectangle" "0,0" p4)
     (command ".Arc" p5 "C" "0,0" p4)
     (command ".UCS" "P")

     (command ".UCS" "3" diem1 p2 p3)
     (command ".rectangle" "0,0" p4)
     (command ".Arc" p5 "C" "0,0" p4)     
     (command ".UCS" "P")      

     (command ".UCS" "3" p2 p1 p3)
     (command ".rectangle" "0,0" p4)
     (command ".Arc" p5 "C" "0,0" p4)
     (command ".UCS" "P")

     (command ".UCS" "3" diem3 p1 p3)
     (command ".rectangle" "0,0" p4)
     (command ".Arc" p5 "C" "0,0" p4)
     (command ".UCS" "P")

   )

   (princ "\n3 diem nhap vao khong duoc thang hang")
 )
(setvar "osmode" osm)         
)
;-----------------------------------------------------------------------------

 

Có 3 lệnh trong lisp này.

c1: vẽ cửa đi 1 cánh

c2: vẽ cửa đi 2 cánh

c4: vẽ cửa đi 4 cánh

 

Thế còn cửa sổ thì sao nhỉ ?

 

Bài 6: Vẽ cửa sổ

 

(defun c:w1(/ data_m l1 l2 p1 p2 check)

(defun wd_import(/ p3 p4 p5 p6)
   (setq data_m (ssget))
   (setq p1 (getpoint "\nfirst point :") p2 (getpoint "\nsecond point :"))
   (setq l1 nil l2 nil check 1)
   (if (not (= nil data_m)) (progn
       (setq l1 (entget (ssname data_m 0)))
       (setq l2 (entget (ssname data_m 1)))
       (if (or (= nil l1) (not (= "LINE" (cdr (assoc 0 l1))))) (setq check 0))
       (if (or (= nil l2) (not (= "LINE" (cdr (assoc 0 l2))))) (setq check 0))
       (if (not (= 0 (-(sslength data_m) 2))) (setq check 0))
       (if (= 1 check) (progn
           (setq p3 (cdr (assoc 10 l1))) (setq p3 (list (nth 0 p3) (nth 1 p3)))
           (setq p4 (cdr (assoc 11 l1))) (setq p4 (list (nth 0 p4) (nth 1 p4)))
           (setq p5 (cdr (assoc 10 l2))) (setq p5 (list (nth 0 p5) (nth 1 p5)))
           (setq p6 (cdr (assoc 11 l2))) (setq p6 (list (nth 0 p6) (nth 1 p6)))
           (if (not (= nil (inters p3 p4 p5 p6 nil))) (setq check 0))
       ))
   ) (setq check 0))
   (princ)
)

(defun wd_procced()

(defun mkv(/ p3 p4 p5 p6 p7 p8 p9 ls1 ls2 getom ll1)

   (setq p3 (cdr (assoc 10 l1))) 
   (setq p4 (cdr (assoc 11 l1))) 
   (setq p5 (cdr (assoc 10 l2))) 
   (setq p6 (cdr (assoc 11 l2))) 
   (if (> (abs (- (nth 1 p1) (nth 1 p3)))
          (abs (- (nth 1 p3) (nth 1 p4))) ) (setq check 0))
   (if (> (abs (- (nth 1 p1) (nth 1 p4)))
          (abs (- (nth 1 p3) (nth 1 p4))) ) (setq check 0))
   (if (> (abs (- (nth 1 p2) (nth 1 p5)))
          (abs (- (nth 1 p5) (nth 1 p6))) ) (setq check 0))
   (if (> (abs (- (nth 1 p2) (nth 1 p6)))
          (abs (- (nth 1 p5) (nth 1 p6))) ) (setq check 0))
   (if (= 0 check) (princ "\ninvalid data") (progn
       (setq ls1 (arlst (list (nth 1 p1) (nth 1 p2) (nth 1 p3) (nth 1 p4) )))
;        (princ ls1)
       (setq p7 (list (nth 0 p3) (nth 0 ls1) 0))
       (setq p8 (list (nth 0 p3) (nth 1 ls1) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 0 p3) (nth 2 ls1) 0))
       (setq p8 (list (nth 0 p3) (nth 3 ls1) 0))
       (mkline p7 p8 l1)

       (setq ls1 (arlst (list (nth 1 p1) (nth 1 p2) (nth 1 p5) (nth 1 p6) )))
;        (princ ls1)
       (setq p7 (list (nth 0 p5) (nth 0 ls1) 0))
       (setq p8 (list (nth 0 p5) (nth 1 ls1) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 0 p5) (nth 2 ls1) 0))
       (setq p8 (list (nth 0 p5) (nth 3 ls1) 0))
       (mkline p7 p8 l1)

       (setq p7 (list (nth 0 p3) (nth 1 ls1) 0))
       (setq p8 (list (nth 0 p5) (nth 1 ls1) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 0 p3) (nth 2 ls1) 0))
       (setq p8 (list (nth 0 p5) (nth 2 ls1) 0))
       (mkline p7 p8 l1)

       (setq getom (getvar "osmode"))
       (setvar "osmode" 0)

       (setq ls2 (arlst (list (nth 0 p3) (nth 0 p5))))
       (setq p7 (list (nth 0 ls2) (nth 1 ls1) 0))
       (setq p8 (list (nth 1 ls2) (nth 2 ls1) 0))

       (setq ll1 (list
           (cons 0 "line")
           (cons 8 (getvar "clayer"))
       ))

       (drawrt2 p7 p8 ll1)

       (setvar "osmode" getom)
       (command "erase" data_m "")

   ))
   (princ)
)

(defun mkh(/ p3 p4 p5 p6 p7 p8 p9 ls1 ls2 getom ll1)

   (setq p3 (cdr (assoc 10 l1))) 
   (setq p4 (cdr (assoc 11 l1))) 
   (setq p5 (cdr (assoc 10 l2))) 
   (setq p6 (cdr (assoc 11 l2))) 

   (if (> (abs (- (nth 0 p1) (nth 0 p3)))
          (abs (- (nth 0 p3) (nth 0 p4))) ) (setq check 0))
   (if (> (abs (- (nth 0 p1) (nth 0 p4)))
          (abs (- (nth 0 p3) (nth 0 p4))) ) (setq check 0))
   (if (> (abs (- (nth 0 p2) (nth 0 p5)))
          (abs (- (nth 0 p5) (nth 0 p6))) ) (setq check 0))
   (if (> (abs (- (nth 0 p2) (nth 0 p6)))
          (abs (- (nth 0 p5) (nth 0 p6))) ) (setq check 0))

   (if (= 0 check) (princ "\ninvalid data") (progn

       (setq ls1 (arlst (list (nth 0 p1) (nth 0 p2) (nth 0 p3) (nth 0 p4) )))
;        (princ ls1)
       (setq p7 (list (nth 0 ls1) (nth 1 p3) 0))
       (setq p8 (list (nth 1 ls1) (nth 1 p3) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 2 ls1) (nth 1 p3) 0))
       (setq p8 (list (nth 3 ls1) (nth 1 p3) 0))
       (mkline p7 p8 l1)

       (setq ls1 (arlst (list (nth 0 p1) (nth 0 p2) (nth 0 p5) (nth 0 p6) )))
;        (princ ls1)
       (setq p7 (list (nth 0 ls1) (nth 1 p5) 0))
       (setq p8 (list (nth 1 ls1) (nth 1 p5) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 2 ls1) (nth 1 p5) 0))
       (setq p8 (list (nth 3 ls1) (nth 1 p5) 0))
       (mkline p7 p8 l1)

       (setq p7 (list (nth 1 ls1) (nth 1 p3) 0))
       (setq p8 (list (nth 1 ls1) (nth 1 p5) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 2 ls1) (nth 1 p3) 0))
       (setq p8 (list (nth 2 ls1) (nth 1 p5) 0))
       (mkline p7 p8 l1)

       (setq getom (getvar "osmode"))
       (setvar "osmode" 0)

       (setq ls2 (arlst (list (nth 1 p3) (nth 1 p5))))
       (setq p7 (list (nth 1 ls1) (nth 0 ls2) 0))
       (setq p8 (list (nth 2 ls1) (nth 1 ls2) 0))

       (setq ll1 (list
           (cons 0 "line")
           (cons 8 (getvar "clayer"))
       ))

       (drawrt3 p7 p8 ll1)

       (setvar "osmode" getom)
       (command "erase" data_m "")


   ))
   (princ)
)

   (setvar "cmdecho" 0) (command "undo" "mark") (setvar "cmdecho" 1)
   (if (= 0 check) (princ "\ninvalid data") (progn
       (if (< (abs (- (nth 0 (cdr (assoc 10 l1)))
                      (nth 0 (cdr (assoc 11 l1))) )) 0.00001) (mkv))
       (if (< (abs (- (nth 1 (cdr (assoc 10 l1)))
                      (nth 1 (cdr (assoc 11 l1))) )) 0.00001) (mkh))


   ))

   (princ)

)
   (wd_import)
 	(ai_undo_push)
   (wd_procced)
 	(ai_undo_pop)	
)


(defun c:w2(/ data_m l1 l2 p1 p2 check)

(defun wd_import(/ p3 p4 p5 p6)
   (setq data_m (ssget))
   (setq p1 (getpoint "\nfirst point :") p2 (getpoint "\nsecond point :"))
   (setq l1 nil l2 nil check 1)
   (if (not (= nil data_m)) (progn
       (setq l1 (entget (ssname data_m 0)))
       (setq l2 (entget (ssname data_m 1)))
       (if (or (= nil l1) (not (= "LINE" (cdr (assoc 0 l1))))) (setq check 0))
       (if (or (= nil l2) (not (= "LINE" (cdr (assoc 0 l2))))) (setq check 0))
       (if (not (= 0 (-(sslength data_m) 2))) (setq check 0))
       (if (= 1 check) (progn
           (setq p3 (cdr (assoc 10 l1))) (setq p3 (list (nth 0 p3) (nth 1 p3)))
           (setq p4 (cdr (assoc 11 l1))) (setq p4 (list (nth 0 p4) (nth 1 p4)))
           (setq p5 (cdr (assoc 10 l2))) (setq p5 (list (nth 0 p5) (nth 1 p5)))
           (setq p6 (cdr (assoc 11 l2))) (setq p6 (list (nth 0 p6) (nth 1 p6)))
           (if (not (= nil (inters p3 p4 p5 p6 nil))) (setq check 0))
       ))
   ) (setq check 0))
   (princ)
)

(defun wd_procced()

(defun mkv(/ p3 p4 p5 p6 p7 p8 p9 ls1 ls2 getom ll1)

   (setq p3 (cdr (assoc 10 l1))) 
   (setq p4 (cdr (assoc 11 l1))) 
   (setq p5 (cdr (assoc 10 l2))) 
   (setq p6 (cdr (assoc 11 l2))) 
   (if (> (abs (- (nth 1 p1) (nth 1 p3)))
          (abs (- (nth 1 p3) (nth 1 p4))) ) (setq check 0))
   (if (> (abs (- (nth 1 p1) (nth 1 p4)))
          (abs (- (nth 1 p3) (nth 1 p4))) ) (setq check 0))
   (if (> (abs (- (nth 1 p2) (nth 1 p5)))
          (abs (- (nth 1 p5) (nth 1 p6))) ) (setq check 0))
   (if (> (abs (- (nth 1 p2) (nth 1 p6)))
          (abs (- (nth 1 p5) (nth 1 p6))) ) (setq check 0))
   (if (= 0 check) (princ "\ninvalid data") (progn
       (setq ls1 (arlst (list (nth 1 p1) (nth 1 p2) (nth 1 p3) (nth 1 p4) )))
;        (princ ls1)
       (setq p7 (list (nth 0 p3) (nth 0 ls1) 0))
       (setq p8 (list (nth 0 p3) (nth 1 ls1) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 0 p3) (nth 2 ls1) 0))
       (setq p8 (list (nth 0 p3) (nth 3 ls1) 0))
       (mkline p7 p8 l1)

       (setq ls1 (arlst (list (nth 1 p1) (nth 1 p2) (nth 1 p5) (nth 1 p6) )))
;        (princ ls1)
       (setq p7 (list (nth 0 p5) (nth 0 ls1) 0))
       (setq p8 (list (nth 0 p5) (nth 1 ls1) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 0 p5) (nth 2 ls1) 0))
       (setq p8 (list (nth 0 p5) (nth 3 ls1) 0))
       (mkline p7 p8 l1)

       (setq p7 (list (nth 0 p3) (nth 1 ls1) 0))
       (setq p8 (list (nth 0 p5) (nth 1 ls1) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 0 p3) (nth 2 ls1) 0))
       (setq p8 (list (nth 0 p5) (nth 2 ls1) 0))
       (mkline p7 p8 l1)

       (setq ls2 (arlst (list (nth 0 p3) (nth 0 p5))))

       (setq ll1 (list
           (cons 0 "line")
           (cons 8 (getvar "clayer"))
       ))

	(if (< (nth 0 p1) (nth 0 ls2)) (progn
       	(setq p7 (list (nth 0 ls2) (nth 1 ls1) 0))
		(setq p8 (list (nth 1 ls2) (nth 2 ls1) 0))
		(setq p7 (list (* (+ (nth 0 p7) (nth 0 p8)) 0.5) (nth 1 p7) 0))
       	(drawrt2 p7 p8 ll1)

		(setq p7 (list (- (nth 0 ls2) 70) (- (nth 1 ls1) 100) 0))
		(setq p8 (list (- (nth 0 ls2) 70) (+ (nth 2 ls1) 100) 0))
		(mkline p7 p8 ll1)

		(setq p9 (list (+ (nth 0 p7) 70) (nth 1 p7) 0))
		(mkline p7 p9 ll1)

		(setq p9 (list (+ (nth 0 p8) 70) (nth 1 p8) 0))
		(mkline p8 p9 ll1)
    )(progn
	   	(setq p7 (list (nth 0 ls2) (nth 1 ls1) 0))
		(setq p8 (list (nth 1 ls2) (nth 2 ls1) 0))
		(setq p8 (list (* (+ (nth 0 p7) (nth 0 p8)) 0.5) (nth 1 p8) 0))
       	(drawrt2 p7 p8 ll1)

		(setq p7 (list (+ (nth 1 ls2) 70) (- (nth 1 ls1) 100) 0))
		(setq p8 (list (+ (nth 1 ls2) 70) (+ (nth 2 ls1) 100) 0))
		(mkline p7 p8 ll1)

		(setq p9 (list (- (nth 0 p7) 70) (nth 1 p7) 0))
		(mkline p7 p9 ll1)

		(setq p9 (list (- (nth 0 p8) 70) (nth 1 p8) 0))
		(mkline p8 p9 ll1)
	))


       (command "erase" data_m "")

   ))
   (princ)
)

(defun mkh(/ p3 p4 p5 p6 p7 p8 p9 ls1 ls2 getom ll1)

   (setq p3 (cdr (assoc 10 l1))) 
   (setq p4 (cdr (assoc 11 l1))) 
   (setq p5 (cdr (assoc 10 l2))) 
   (setq p6 (cdr (assoc 11 l2))) 

   (if (> (abs (- (nth 0 p1) (nth 0 p3)))
          (abs (- (nth 0 p3) (nth 0 p4))) ) (setq check 0))
   (if (> (abs (- (nth 0 p1) (nth 0 p4)))
          (abs (- (nth 0 p3) (nth 0 p4))) ) (setq check 0))
   (if (> (abs (- (nth 0 p2) (nth 0 p5)))
          (abs (- (nth 0 p5) (nth 0 p6))) ) (setq check 0))
   (if (> (abs (- (nth 0 p2) (nth 0 p6)))
          (abs (- (nth 0 p5) (nth 0 p6))) ) (setq check 0))

   (if (= 0 check) (princ "\ninvalid data") (progn

       (setq ls1 (arlst (list (nth 0 p1) (nth 0 p2) (nth 0 p3) (nth 0 p4) )))
;        (princ ls1)
       (setq p7 (list (nth 0 ls1) (nth 1 p3) 0))
       (setq p8 (list (nth 1 ls1) (nth 1 p3) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 2 ls1) (nth 1 p3) 0))
       (setq p8 (list (nth 3 ls1) (nth 1 p3) 0))
       (mkline p7 p8 l1)

       (setq ls1 (arlst (list (nth 0 p1) (nth 0 p2) (nth 0 p5) (nth 0 p6) )))
;        (princ ls1)
       (setq p7 (list (nth 0 ls1) (nth 1 p5) 0))
       (setq p8 (list (nth 1 ls1) (nth 1 p5) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 2 ls1) (nth 1 p5) 0))
       (setq p8 (list (nth 3 ls1) (nth 1 p5) 0))
       (mkline p7 p8 l1)

       (setq p7 (list (nth 1 ls1) (nth 1 p3) 0))
       (setq p8 (list (nth 1 ls1) (nth 1 p5) 0))
       (mkline p7 p8 l1)
       (setq p7 (list (nth 2 ls1) (nth 1 p3) 0))
       (setq p8 (list (nth 2 ls1) (nth 1 p5) 0))
       (mkline p7 p8 l1)

	(setq getom (getvar "osmode"))
       (setvar "osmode" 0)

	(setq ll1 (list
            (cons 0 "line")
            (cons 8 (getvar "clayer"))
        ))
	(setq ls2 (arlst (list (nth 1 p3) (nth 1 p5))))
	;(princ ls2)

	(if (> (nth 1 p1) (nth 1 ls2)) (progn

       	(setq p7 (list (nth 1 ls1) (nth 0 ls2) 0))
       	(setq p8 (list (nth 2 ls1) (nth 1 ls2) 0))
		(setq p8 (list (nth 2 ls1) (* (+ (nth 1 p7) (nth 1 p8)) 0.5) 0))

       	(drawrt3 p7 p8 ll1)

		(setq p7 (list (- (nth 1 ls1) 100) (+ (nth 1 ls2) 70) 0))
		(setq p8 (list (+ (nth 2 ls1) 100) (+ (nth 1 ls2) 70) 0))
		(mkline p7 p8 ll1)

		(setq p9 (list (nth 0 p7) (- (nth 1 p7) 70) 0))
		(mkline p7 p9 ll1)

		(setq p9 (list (nth 0 p8) (- (nth 1 p8) 70) 0))
		(mkline p8 p9 ll1)
	)(progn
	  	(setq p7 (list (nth 1 ls1) (nth 0 ls2) 0))
       	(setq p8 (list (nth 2 ls1) (nth 1 ls2) 0))
		(setq p7 (list (nth 1 ls1) (* (+ (nth 1 p7) (nth 1 p8)) 0.5) 0))

		(drawrt3 p7 p8 ll1)


		(setq p7 (list (- (nth 1 ls1) 100) (- (nth 0 ls2) 70) 0))
		(setq p8 (list (+ (nth 2 ls1) 100) (- (nth 0 ls2) 70) 0))
		(mkline p7 p8 ll1)

		(setq p9 (list (nth 0 p7) (+ (nth 1 p7) 70) 0))
		(mkline p7 p9 ll1)

		(setq p9 (list (nth 0 p8) (+ (nth 1 p8) 70) 0))
		(mkline p8 p9 ll1)


	))

	(setvar "osmode" getom)

       (command "erase" data_m "")


   ))
   (princ)
)

   (setvar "cmdecho" 0) (command "undo" "mark") (setvar "cmdecho" 1)
   (if (= 0 check) (princ "\ninvalid data") (progn
       (if (< (abs (- (nth 0 (cdr (assoc 10 l1)))
                      (nth 0 (cdr (assoc 11 l1))) )) 0.00001) (mkv))
       (if (< (abs (- (nth 1 (cdr (assoc 10 l1)))
                      (nth 1 (cdr (assoc 11 l1))) )) 0.00001) (mkh))


   ))

   (princ)

)
   (wd_import)
   (wd_procced)
)

 

Có 2 lệnh trong lisp này.

w1: vẽ cửa sổ kiểu 1

w2: vẽ cửa sổ kiểu 2

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

sao phần vẽ cửa ko đc nhỉ mà sau khi kết thúc lệnh thì các bắt điểm lại tắt hết đi hả bạn. ai sửa đc vễ cửa rồi giúp mình với. mỗi lệnh cần nhất lại ko dùng đc hic hic :angry:

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

lệnh vẽ cửa đi thì ok rồi

còn vẽ cửa sổ vẫn chưa hiểu lam

làm mãi ko được

ban nào rỗi chi mình với

thao tác đầy đủ nhé

ban ơi cửa đi cài lips song dùng đc luôn ak lúc đầu có lỗi j ko sao mình làm ko đc

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

Chào bạn chủ pick , mình có đọc bài của bạn và mình thấy nó vô cùng hữu ích cho mọi người , cám ơn bạn rất nhiều , À mà mình có vấn đề này muốn hỏi đó là LISP tạo layer ( TaoL) , bạn có thể thêm vào đó hiệu chỉnh linetype và lineweight được không , hi

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

Bác Hoành bác Tuệ có thể giúp e việc đưa linetype và lineweight vào lisp Taol được không , trăm sự nhờ các bác vì công việc của e đang rất cần cái này , thanks you verry much !!

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

thanks các bác nhiệt tình chia sẻ và giải đáp! nhưng quả thật mình ko dùng được lips tạo cửa đi và cửa sổ. Rất mong được các bác hướng dẫn cụ thể

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

Bác Hoành bác Tuệ có thể giúp e việc đưa linetype và lineweight vào lisp Taol được không , trăm sự nhờ các bác vì công việc của e đang rất cần cái này , thanks you verry much !!

Hề hề hề,

Cái lisp này tạo ra hàng loạt layer khác nhau, mà bạn muốn thêm linetype và lineweight và layer nào??? và bạn muốn loại linetype nào?? Lineweight bao nhiề hè???

Nếu không nói cho rõ được thì chớ có chờ nữa, hãy tụ mình giải quyết thôi....

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

:unsure:  :wacko: .....

bác nào giúp em với ạ .... sao em không dùng líp cửa được vậy ạ  :wacko:

em ap và dùng c1 ... k đọc được lệnh ạ

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ấy cái lệnh hatch e load toàn lỗi không sử dụng được các bác xem hộ e phát 

 
Command: ap
APPLOAD hc_hm_ha_hs.lsp successfully loaded.
Command: ; error: malformed list on input

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

×