Rated 5/5 based on 240179 internet user reviews

Đến nội dung


Hình ảnh
- - - - -

[Nhờ chỉnh sửa] lisp vẽ cửa sổ-cửa đi


  • Please log in to reply
2 replies to this topic

#1 htqk9

htqk9

    biết vẽ circle

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

Đã gửi 17 May 2012 - 08:05 AM

Mình đang dung lisp vẽ cửa đi, cửa sổ: CD1-cửa đi 1 cánh, CD2-cửa đi 2 cánh, CS-cửa sổ 1 lớp, CS2-cửa sổ 2 lớp...(Toàn bộ là khuôn cửa kép)

Giờ Mình muốn nhờ các pro sửa và thêm các loại cửa như:
CD1: cửa đi 1 cánh, khuôn kép
CD2: cửa đi 2 cánh, khuôn kép
CD4: cửa đi 4 cánh, khuôn kép
CD1D: cửa đi 1 cánh, khuôn đơn
CD2D: cửa đi 2 cánh, khuôn đơn
CD4D: cửa đi 4 cánh, khuôn đơn

CS -đổi tên thành CS21: cửa sổ 1 lớp 2 cánh khuôn kép
CS2-đổi tên thành CS22: cửa sổ 2 lớp 2 cánh khuôn kép
CS41: cửa sổ 1 lớp 4 cánh khuôn kép
CS42: cửa sổ 2 lớp 4 cánh khuôn kép
CS2D: cửa sổ 1 lớp 2 cánh khuôn đơn
CS4D: cửa sổ 1 lớp 4 cánh khuôn đơn

Cụ thể như file đính kèm
http://www.cadviet.c..._socua_di_2.dwg

;;===================== CUA DI HAI CANH ===========================
(defun c:cd2 ()
(setvar "cmdecho" 0)
(setq v (getvar "osmode"))
(prompt "\nVe cua di 2 canh.")
;;(setvar "osmode" 512)
(setq DC (getpoint "\nDiem giua cua tren tuong 1: "))
(setvar "Lastpoint" DC)
(setvar "osmode" 128)
(setq P0 (getpoint "\nDiem vuong goc tren tuong 2: "))
;;(if (null H1)
(setq H1 (getvar "tracewid"))<img src='http://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/wink.png' class='bbc_emoticon' alt=';)' />
(princ "\nChieu rong cua <")
(princ H1)
(princ ">: ")
(setq H1 (getdist))
(if (null H1) (setq H1 (getvar "tracewid")))
(setvar "tracewid" H1)
(progn
(setvar "osmode" 0)
(Setvar "Plinewid" 0)
;  (load "attrede")
(setq H (/ H1 2))
(setq B (distance DC P0)
  	goc1 (angle DC P0)
  	goc2 (+ goc1 (* 0.5 pi))
  	goc3 (+ goc2 pi)
  	goc4 (+ goc1 pi)
  	P1 (polar DC goc2 H)
  	P2 (polar DC goc3 H)
  	P3 (polar P1 goc1 <img src='http://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />
  	P4 (polar P2 goc1 <img src='http://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />
  	P5 (polar P1 goc3 50)
  	P6 (polar P2 goc2 50)
  	P7 (polar P5 goc1 40)
  	P8 (polar P6 goc1 40)
  	P9 (polar P7 goc3 10)
  	P10 (polar P8 goc2 10)
  	P11 (polar P3 goc3 60)
  	P12 (polar P4 goc2 60)
  	P13 (polar P4 goc4 (+ H <img src='http://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />)
)
(setq pt1 (polar P5 goc3 40)
  	pt2 (polar P6 goc2 40)
  	pt3 (polar pt1 goc4 (- H 50))
  	pt4 (polar pt2 goc4 (- H 50))
  	pt5 (polar pt3 goc2 40)
  	pt6 (polar pt4 goc3 40))
(setq d1 (polar pt1 goc4 100)
  	d2 (polar pt2 goc4 100)
  	d3 (polar d1 goc2 20)
  	d4 (polar d2 goc3 20)
  	d5 (polar d1 goc2 40)
  	d6 (polar d2 goc3 40)
  	d7 (polar pt3 goc1 100)
  	d8 (polar pt4 goc1 100)
  	d9 (polar d7 goc2 20)
  	d10 (polar d8 goc3 20)
  	d11 (polar d7 goc2 40)
  	d12 (polar d8 goc3 40)
)
(command ".break" P1 P2)
(command    	".break" P3 P4
		".line" P1 P3 ""
  ".Chprop" "L" "" "La" "cat" "" C Bylayer
      	".line" P2 P4 ""
   ".Chprop" "L" "" "La" "cat" "" C Bylayer
      	".pline" P1 P5 P7 P9 P11 P3 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P2 P6 P8 P10 P12 P4 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P5 pt1 pt3 pt5 "c"
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P6 pt2 pt4 pt6 "c"
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d1 d5 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d7 d11 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d2 d6 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d8 d12 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d3 d9 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d4 d10 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
   	".arc" DC (polar pt2 (+ goc2 (* 0.25 pi)) (distance pt2 DC)) pt4
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
		".arc" DC (polar pt1 (+ goc2 (* 0.75 pi)) (distance pt1 DC)) pt3
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
".select" "W" P3 P13 ""
".copybase" DC "P" ""
".pasteblock" DC
".Erase" "P" ""
)
(setvar "osmode" v)
)
(prompt "\nDA VE XONG")
(princ)
)
;;================== VE CUA DI MOT CANH ==================
;;
(defun C:cd1 ()
(setvar "cmdecho" 0)
(setq v (getvar "osmode"))
(prompt "\nVe cua di 1 canh.")
;(setvar "osmode" 32)
(setq PX (getpoint "\nChon goc tuong: "))
(setvar "osmode" 512)
(setq P1 (getpoint PX "\nChon mep tuong 1: "))
(setvar "Lastpoint" P1)
(setvar "osmode" 128)
(setq P2 (getpoint P1 "\nDiem vuong goc tuong 2: "))
;(if (null KC)
(setq KC (getvar "tracewid"))
(princ "\nChieu rong cua <")
(princ KC)
(princ ">: ")
(setq KC (getdist))
(if (null KC) (setq KC (getvar "tracewid")))
(setvar "tracewid" KC)
(setvar "osmode" 0) (Setvar "Plinewid" 0)
;  (load "attrede")
(setq ANG1 (angle PX P1))
(setq ANG2 (angle P2 P1)
  	ANG3 (angle P1 P2)
  	ANG4 (angle P1 PX)
  	P3 (polar P1 ANG1 KC)
  	P4 (polar P2 ANG1 KC)
  	pt1 (polar P1 ANG1 50)
  	pt2 (polar pt1 ANG3 40)
  	pt3 (polar pt2 ANG1 10)
  	pt4 (polar P2 ANG1 60)
  	P5 (polar pt1 ANG2 (- KC 100))
  	P6 (polar P5 ANG1 40)
  	P7 (polar pt1 ANG1 40)
  	P8 (polar P3 ANG2 200)
  	P22 (polar P3 ANG2 (- KC 100))
  	ANG5 (angle P7 P8)
)
(setq d1 (polar pt1 ANG2 100)
  	d2 (polar d1 ANG1 20)
  	d3 (polar d1 ANG1 40)
  	d4 (polar P5 ANG3 100)
  	d5 (polar d4 ANG1 20)
  	d6 (polar d4 ANG1 40)
)
(setq dc1 (polar P3 ANG4 50)
  	dc2 (polar dc1 ANG3 40)
  	dc3 (polar dc2 ANG4 10)
  	dc4 (polar P4 ANG4 60)
)
(command ".break" P1 P3
		".break" P2 P4
		".line" P1 P2 ""
  ".Chprop" "L" "" "La" "cat" "" C Bylayer
		".line" P3 P4 ""
  ".Chprop" "L" "" "La" "cat" "" C Bylayer
		".pline" P1 pt1 pt2 pt3 pt4 P2 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
		".pline" P3 dc1 dc2 dc3 dc4 P4 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
		".pline" pt1 P5 P6 P7 "c"
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
		".line" d1 d3 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
		".line" d4 d6 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
		".line" d2 d5 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
		".arc" dc1 (polar P7 ANG5 (- KC 140)) P6
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
".select" "W" P2 P22 ""
".copybase" P2 "P" ""
".pasteblock" P2
".Erase" "P" ""
)
(setvar "osmode" v)
(prompt "\nDA VE XONG")
(print))
************************************************************************************************
;;===================== CUA SO HAI CANH HAI LOP ===========================
(defun c:cs2 ()
(setvar "cmdecho" 0)
(setq v (getvar "osmode"))
(prompt "\nChuong trinh ve cua so hai canh hai lop.")
(setq DC (getpoint "\nDiem giua cua: "))
(setvar "Lastpoint" DC)
(setvar "osmode" 128)
(setq P0 (getpoint "\nDiem vuong goc tuong con lai: "))
(setq H1 (getvar "tracewid"))
(princ "\nChieu rong cua <")
(princ H1)
(princ ">: ")
(setq H1 (getdist))
(if (null H1) (setq H1 (getvar "tracewid")))
(setvar "tracewid" H1)
(progn
(setvar "osmode" 0) (Setvar "Plinewid" 0)
;(load "attrede")
(setq H (/ H1 2))
(setq B (distance DC P0)
  	goc1 (angle DC P0)
  	goc2 (+ goc1 (* 0.5 pi))
  	goc3 (+ goc2 pi)
  	goc4 (+ goc1 pi)
  	P1 (polar DC goc2 H)
  	P2 (polar DC goc3 H)
  	P3 (polar P1 goc1 <img src='http://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />
  	P4 (polar P2 goc1 <img src='http://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />
  	P5 (polar P1 goc3 50)
  	P6 (polar P2 goc2 50)
  	P7 (polar P5 goc1 40)
  	P8 (polar P6 goc1 40)
  	P9 (polar P7 goc3 10)
  	P10 (polar P8 goc2 10)
  	P11 (polar P3 goc3 50)
  	P12 (polar P4 goc2 50)
  	P13 (polar P11 goc4 40)
  	P14 (polar P12 goc4 40)
  	P15 (polar P13 goc3 10)
  	P16 (polar P14 goc2 10)
)
(setq d1 (polar p5 goc3 80)
  	d2 (polar p6 goc2 80)
  	d3 (polar p7 goc3 80)
  	d4 (polar p8 goc2 80)
  	d5 (polar DC goc1 40)
  	d6 (polar DC goc3 80)
  	d7 (polar DC goc2 80)
  	d8 (polar d5 goc3 80)
  	d9 (polar d5 goc2 80)
  	l1 (polar d1 goc1 20)
  	l2 (polar d2 goc1 20)
  	l3 (polar d7 goc1 20)
  	l4 (polar d6 goc1 20)
)
(setq c1 (polar p11 goc3 80)
  	c2 (polar p12 goc2 80)
  	c3 (polar p13 goc3 80)
  	c4 (polar p14 goc2 80)
  	cc (polar p0 goc4 40)
  	c5 (polar p0 goc2 80)
  	c6 (polar p0 goc3 80)
  	c7 (polar cc goc2 80)
  	c8 (polar cc goc3 80)
)
(command ".break" P1 P2)
(command    	".break" P3 P4
		".line" P1 P3 ""
  ".Chprop" "L" "" "La" "cat" "" C Bylayer
      	".line" P2 P4 ""
   ".Chprop" "L" "" "La" "cat" "" C Bylayer
      	".pline" P1 P5 P7 P9 P15 P13 P11 P3 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P2 P6 P8 P10 P16 P14 P12 P4 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P5 P7 d5 DC "c"
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P6 P8 d5 DC "c"
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d1 d3 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d7 d9 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d2 d4 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d8 d6 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" l1 l3 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" l2 l4 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P11 P13 cc p0 "c"
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P12 P14 cc p0 "c"
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" c1 c3 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" c7 c5 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" c2 c4 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" c6 c8 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
".select" "W" P1 P4 ""
".copybase" P1 "P" ""
".pasteblock" P1
".Erase" "P" ""
  )
)
(setvar "osmode" v)
(prompt "\nda ve xong.")
(princ)
)
;;===================== CUA SO HAI CANH ===========================
(defun c:cs ()
(setvar "cmdecho" 0)
(setq v (getvar "osmode"))
(prompt "\nChuong trinh ve cua so hai canh.")
(setq DC (getpoint "\nDiem giua cua so: "))
(setvar "Lastpoint" DC)
(setvar "osmode" 128)
(setq P0 (getpoint "\nDiem vuong goc tuong con lai: "))
(setq H1 (getvar "tracewid"))
(princ "\nChieu rong cua <")
(princ H1)
(princ ">: ")
(setq H1 (getdist))
(if (null H1) (setq H1 (getvar "tracewid")))
(setvar "tracewid" H1)
(progn
(setvar "osmode" 0) (Setvar "Plinewid" 0)
;(load "attrede")
(setq H (/ H1 2))
(setq B (distance DC P0)
  	goc1 (angle DC P0)
  	goc2 (+ goc1 (* 0.5 pi))
  	goc3 (+ goc2 pi)
  	goc4 (+ goc1 pi)
  	P1 (polar DC goc2 H)
  	P2 (polar DC goc3 H)
  	P3 (polar P1 goc1 <img src='http://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />
  	P4 (polar P2 goc1 <img src='http://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />
  	P5 (polar P1 goc3 50)
  	P6 (polar P2 goc2 50)
  	P7 (polar P5 goc1 40)
  	P8 (polar P6 goc1 40)
  	P9 (polar P7 goc3 10)
  	P10 (polar P8 goc2 10)
  	P11 (polar P3 goc3 60)
  	P12 (polar P4 goc2 60)
)
(setq d1 (polar p5 goc3 80)
  	d2 (polar p6 goc2 80)
  	d3 (polar p7 goc3 80)
  	d4 (polar p8 goc2 80)
  	d5 (polar DC goc1 40)
  	d6 (polar DC goc3 80)
  	d7 (polar DC goc2 80)
  	d8 (polar d5 goc3 80)
  	d9 (polar d5 goc2 80)
  	l1 (polar d1 goc1 20)
  	l2 (polar d2 goc1 20)
  	l3 (polar d7 goc1 20)
  	l4 (polar d6 goc1 20)
)
(command ".break" P1 P2)
(command    	".break" P3 P4
		".line" P1 P3 ""
  ".Chprop" "L" "" "La" "cat" "" C Bylayer
      	".line" P2 P4 ""
   ".Chprop" "L" "" "La" "cat" "" C Bylayer
      	".pline" P1 P5 P7 P9 P11 P3 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P2 P6 P8 P10 P12 P4 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P5 P7 d5 DC "c"
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".pline" P6 P8 d5 DC "c"
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d1 d3 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d7 d9 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d2 d4 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" d8 d6 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" l1 l3 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" l2 l4 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
      	".line" P11 P12 ""
   ".Chprop" "L" "" "La" "cua" "" C Bylayer
".select" "W" P1 P4 ""
".copybase" P1 "P" ""
".pasteblock" P1
".Erase" "P" ""
    	)
(setvar "osmode" v)
)
(prompt "\nda ve xong.")
(princ)
)

  • 0
...nothing 4ever...

#2 htqk9

htqk9

    biết vẽ circle

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

Đã gửi 19 May 2012 - 10:43 PM

hic...k có pro nào giúp...buồn nhỉ!
  • 0
...nothing 4ever...

#3 thichhoabinh

thichhoabinh

    biết vẽ circle

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

Đã gửi 20 May 2012 - 08:25 AM

Giúp thì cũng 1 2 cái thôi chứ, đưa lên cả lô thế kia người ta ngồi không làm cho bạn hay sao. Đã thế nội quy ghi rõ ràng là nêu các bước nhập, đầu vào đầu ra, ở đây chẳng thấy
  • 0