Đến nội dung


Hình ảnh
- - - - -

[Nhờ chỉnh sửa] File lisp


  • Please log in to reply
3 replies to this topic

#1 cd2k44

cd2k44

    Edu level: li5

  • Members
  • PipPipPipPipPipPipPip
  • 648 Bài viết
Điểm đánh giá: 121 (tàm tạm)

Đã gửi 16 September 2011 - 12:14 PM

Có 1 người bạn gửi cho mình 1 file lisp nhưng khi mở file lisp thì thấy lạ ở chỗ thiết câu lệnh là "defun d:xxx",load lisp lên thì không chạy được,sau đó mình đổi lại thành defun c nhưng load lisp lên cũng không chạy được.Nhờ các bác test giùm em

;;;;;d:str;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun d:str (stri def)
(princ stri) (princ "<") (princ def) (princ ">") (princ "")
);;;;;;;;;;;het ham
;;;;;d:kc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun d:kc (Po caunhac def / tam)
(if def
(if Po (setq tam (getdist Po (d:str caunhac def)) tam (getdist (d:str caunhac def)))
)
(if Po (setq def (getdist Po caunhac) tam (getdist caunhac))
)
)
(if tam (setq def tam))
def
);;;;;;;;;;;het ham
;;;;ham doi do sang rad;;;;;;;;;;;;;;;;;;;;
(defun d:rad(a)
(* pi (/ a 180.0))
);;;;;;;;;;;het ham
;;;;ham doi rad sang do;;;;;;;;;;;;;;;;;;;;
(defun d:do(rad)
(* (/ rad pi) 180.0)
);;;;;;;;;;;het ham
;;;;ham tinh tang cua goc;;;;;;;;;;;;;;;;;;;;
(defun Tan(ang)
(/ (sin ang) (cos ang))
);;;;;;;;;;;het ham
;;;;ham tinh binh phuong;;;;;;;;;;;;;;;;;;;;
(defun d:bp(a)
(* a a)
);;;;;;;;;;;het ham
;;;;kich thuoc ban kinh tu soan;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun d:ktbk(p sse / txt r)
(if sse
(setq txt (* sse 100) r (strcat "r" (rtos txt))
)
);if
(command "QLEADER" p (polar p (d:rad 15) 2) "" r ""
)
);;;;;;;;;;;het ham
;;;;;ham ve tim nut;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun d:vtim(p1 p2 p3 p4 a l tk tkP rpt)
(command "zoom" "w" (list (- (car p1) 10) (+ (cadr p1) 10)) (list (- (car p4) 10) (+ (cadr p4) 10))
"-layer" "s" "timdg" "" "pline" p1 "W" 0 0 p2 (polar p2 a l) "" "arc" p3 p4 p2 ""
(progn (if (and (> (cal "2*(tieptuyen+blea_d+10)") 50.38) (< (cal "2*(tieptuyen+blea_d+10)") 62.98))
(setq tle "chu1-250" kt "kthuoc1-250" mten "mtentyle1-250") (setq tle "chu1-200" kt "kthuoc1-200" mten "mtentyle1-200")
);;;;;;;;het if;;;;;;;;;;;;;;;;;;;;
(if (and (> (cal "2*(tieptuyen+blea_d+10)") 62.98) (< (cal "2*(tieptuyen+blea_d+10)") 100.76))
(setq tle "chu1-400" kt "kthuoc1-400" mten "mtentyle1-400")
(if (> (cal "2*(tieptuyen+blea_d+10)") 100.76) (setq tle "chu1-500" kt "kthuoc1-500" mten "mtentyle1-500")
);;;het if;;;;;;;;;;;;;;;;;;;
);;;;;;;;het if;;;;;;;;;;;;;;;;;;;;
);;;;het progn;;;;;;;;;;;;;;;;;;;;;;;;;;
"-layer" "s" "cdtk" "" "text" "s" tle "j" "c" p2 0 (rtos tk) "text" "j" "c" p4 0 (rtos tkP)
);;;;het com;;;;;;;;;;;;;;;;
(command "-layer" "s" kt "" "-DIMSTYLE" "r" mten "")
(d:ktbk p4 rpt)
)
;;;;het ham;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;ham ve mep mat duong 4 goc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun d:vmat(p1 p2 p3 p4 p5 rbk xet tk tkP tk1)
(if (= xet "vmat") (command "-layer" "s" "mepdg" ""))
(if (= xet "vle") (command "-layer" "s" "meple" ""))
(command "zoom" "C" tam 4 "pline" p1 p2 "A" "S"p3 p4 "L" p5 "")
(progn (if (and (> (cal "2*(tieptuyen+blea_d+10)") 50.38) (< (cal "2*(tieptuyen+blea_d+10)") 62.98))
(setq tle "chu1-250" kt "kthuoc1-250" mten "mtentyle1-250") (setq tle "chu1-200" kt "kthuoc1-200" mten "mtentyle1-200")
);;;;;;;;het if;;;;;;;;;;;;;;;;;;;;
(if (and (> (cal "2*(tieptuyen+blea_d+10)") 62.98) (< (cal "2*(tieptuyen+blea_d+10)") 100.76))
(setq tle "chu1-400" kt "kthuoc1-400" mten "mtentyle1-400")
(if (> (cal "2*(tieptuyen+blea_d+10)") 100.76) (setq tle "chu1-500" kt "kthuoc1-500" mten "mtentyle1-500")
);;;het if;;;;;;;;;;;;;;;;;;;
);;;;;;;;het if;;;;;;;;;;;;;;;;;;;;
);;;;het progn;;;;;;;;;;;;;;;;;;;;;;;;;;
(command "-layer" "s" kt "" "-DIMSTYLE" "R" mten "")
(setq r (* rbk 100) r (rtos r) r (strcat "r" r))
(command "QLEADER" p3 (polar p3 (d:rad 10) 2) "" r "" )
(command "-layer" "s" "cdtk" "" "text" "s" tle "j" "c" p2 0 (rtos tk) "text" "j" "c" p3 0 (rtos tkP) "text" "j" "c" p4 0 (rtos tk1))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;ham ve mui ten chi huong;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun muiten(pt1 pt2 g pt3 pt4 p pt5 pt6 tenhg)
(setq d1 (polar pt1 g 1) d2 (polar pt2 g 1) d3 (polar pt1 g 2) d4 (polar pt2 g 2) gv (+ g (/ pi 2)) gv1 (+ g (d:rad 285))
d5 (polar pt1 g 3) d6 (polar pt1 g 4) d7 (polar d6 gv 2) d8 (polar d7 gv1 10) _g (- g (d:rad 90)) _gv1 (- gv1 (d:rad 30))
d5p (polar pt2 g 3) d6p (polar pt2 g 4) d7p (polar d6p _g 2) d8p (polar d7p _gv1 10)
d9 (inters d7 d8 d8p d7p nil) lgiua (* (/ (distance pt1 pt2) 2) -1) tdiem (polar d5 gv lgiua) tdiem (polar tdiem g 1)
);;;;;;;;;;;het setq
(command "-layer" "s" "mthg" "")
(progn (if (and (> (cal "2*(tieptuyen+blea_d+10)") 50.38) (< (cal "2*(tieptuyen+blea_d+10)") 62.98))
(setq tle "chu1-250" kt "kthuoc1-250" mten "tyle1-250") (setq tle "chu1-200" kt "kthuoc1-200" mten "tyle1-200")
);;;;;;;;het if;;;;;;;;;;;;;;;;;;;;
(if (and (> (cal "2*(tieptuyen+blea_d+10)") 62.98) (< (cal "2*(tieptuyen+blea_d+10)") 100.76))
(setq tle "chu1-400" kt "kthuoc1-400" mten "tyle1-400")
(if (> (cal "2*(tieptuyen+blea_d+10)") 100.76) (setq tle "chu1-500" kt "kthuoc1-500" mten "tyle1-500")
);;;het if;;;;;;;;;;;;;;;;;;;
);;;;;;;;het if;;;;;;;;;;;;;;;;;;;;
);;;;het progn;;;;;;;;;;;;;;;;;;;;;;;;;;
(command "pline" pt1 pt2 "" "pline" d1 d2 d4 d3 "c" "" "pline" d5 d6 d7 d9 d7p d6p d5p "c" ""
"-layer" "s" kt "" "-DIMSTYLE" "r" mten ""
"DIMALIGNED" pt1 pt3 (polar pt1 g -1.8) "" "DIMALIGNED" pt3 pt4 (polar pt3 g -1.8) "" "DIMALIGNED" pt4 pt2 (polar pt4 g -1.8) ""
"text" "s" tle "j" "mc" tdiem (- (d:do g) 90) tenhg "scale" "last" "" tdiem 1.8

);;;;;;;;;;;het lenh
);;;;;;;;;;;het ham
;;;;ham tinh va ve cac diem pham vi thiet ke nut
(defun d:vpvn(t1 t2 t3 t4 g l1 l2 t5 t6)
(if (< (- (distance t1 t2) (distance t3 t4)) 0)
(setq pv1 (polar t2 (- g (d:rad 90)) 1) pv2 (inters t2 pv1 t5 t6 nil) pv3 (inters pv1 pv2 t3 t4 nil) pv1 (inters pv3 pv2 t1 t2 nil)
);;;het setq
(setq pv1 (polar t4 (- g (d:rad 90)) 1) pv2 (inters t4 pv1 t5 t6 nil) pv3 (inters pv1 pv2 t1 t2 nil) pv1 (inters pv3 pv2 t3 t4 nil)
);;;het setq
);;;het if;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(command "-layer" "s" "pvtknut" "")
(progn (if (and (> (cal "2*(tieptuyen+blea_d+10)") 50.38) (< (cal "2*(tieptuyen+blea_d+10)") 62.98))
(setq tle "chu1-250" kt "kthuoc1-250" mten "tyle1-250") (setq tle "chu1-200" kt "kthuoc1-200" mten "tyle1-200")
);;;;;;;;het if;;;;;;;;;;;;;;;;;;;;
(if (and (> (cal "2*(tieptuyen+blea_d+10)") 62.98) (< (cal "2*(tieptuyen+blea_d+10)") 100.76))
(setq tle "chu1-400" kt "kthuoc1-400" mten "tyle1-400")
(if (> (cal "2*(tieptuyen+blea_d+10)") 100.76) (setq tle "chu1-500" kt "kthuoc1-500" mten "tyle1-500")
);;;het if;;;;;;;;;;;;;;;;;;;
);;;;;;;;het if;;;;;;;;;;;;;;;;;;;;
);;;;het progn;;;;;;;;;;;;;;;;;;;;;;;;;;

(command "zoom" "w" '((- (car t1) 10) (- (cadr t1) 5)) '((- (car t6) 10) (- (cadr t6) 5)) "line" pv1 pv2 pv3 ""
"-layer" "s" kt "" "-DIMSTYLE" "r" mten ""
"QLEADER" pv1 (polar pv1 (- g (d:rad 45)) 5) "" "ph&#185;m vi thi&#213;t k&#213; n&#243;t" "" )
);;;het ham;;;;;;;;;;;;;;;;;;;;;
;;;;ham doi do thap phan ra do phut giay;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun d:dms(g)
(if (> g 360) (setq g (- g 360)) (if (> g (* 2 pi)) (setq g (- g (* 2 pi))))
)
(setq
g (d:do g) do (fix g) dle (- g do) mind (* dle 60)
min (fix mind) minle (- mind min) secd (* minle 60) sec (fix secd)
);;;;;;het setq
(progn (if (> (- secd sec) 0.5) (setq sec (+ 1 sec)) (setq sec sec)))
(setq
do (rtos do) min (rtos min) sec (rtos sec) dms (strcat do "d" min "'" sec "''")
);;;het setq ;;;;;;;;
);;;;;het ham;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun C:nut()
(setvar "CMDECHO" 0)
(if (not cal) (command "cal" 1+2+3))
(setq hgb (angtof ghb)
hgb (+ (/ pi 2) hgb)
tc2 (polar tam hgb tieptuyen)
tktam Z
;;;;goc phan A;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
agp (angtof gpa)
gkpa (/ (- pi agp) 2) tanpa (/ (sin gkpa) (cos gkpa))
rpa (/ tieptuyen tanpa) lpatim (- (sqrt (+ (d:bp tieptuyen) (d:bp rpa))) rpa)
goc05a (cal "hgb + agp/2")
);;;;;het setq;;;;;;;;;;;;;;;
(setq
Pa (polar tam goc05a lpatim)
tenga (strcat "&#174;i n&#243;t giao " tenhga)
td2 (polar tam (+ hgb agp) tieptuyen)
mdgtc2t (polar tc2 (+ hgb (/ pi 2)) (/ bmata_d 2))
mdgtc2p (polar tc2 (+ hgb (* (/ pi 2) -1)) (/ bmata_d 2))
tamat (polar mdgtc2t hgb tieptuyen)
tamap (polar mdgtc2p hgb tieptuyen)
mletc2t (polar tc2 (+ hgb (/ pi 2)) (+ (/ bmata_d 2) blea_d))
mletc2p (polar tc2 (+ hgb (* (/ pi 2) -1)) (+ (/ bmata_d 2) blea_d))
tamat1 (polar mletc2t hgb tieptuyen)
tamap1 (polar mletc2p hgb tieptuyen)
;;;;goc phan B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
bgp (angtof gpb)
gkpb (/ (- pi bgp) 2) tanpb (/ (sin gkpb) (cos gkpb))
rpb (/ tieptuyen tanpb) lpbtim (- (sqrt (+ (d:bp tieptuyen) (d:bp rpb))) rpb)
goc05b (cal "hgb + agp + bgp/2")
Pb (polar tam goc05b lpbtim)
tengb (strcat "&#174;i n&#243;t giao " tenhgb)
td1 (polar tam (+ hgb agp bgp) tieptuyen)
mdgtd2t (polar td2 (+ hgb agp (/ pi 2)) (/ bmata_b 2))
mdgtd2p (polar td2 (+ hgb agp (* (/ pi 2) -1)) (/ bmata_b 2))
tambt (polar mdgtd2t (+ hgb agp) tieptuyen)
tambp (polar mdgtd2p (+ hgb agp) tieptuyen)
mletd2t (polar td2 (+ hgb agp (/ pi 2)) (+ (/ bmata_b 2) blea_B))
mletd2p (polar td2 (+ hgb agp (* (/ pi 2) -1)) (+ (/ bmata_b 2) blea_B))
tambt1 (polar mletd2t (+ hgb agp) tieptuyen)
tambp1 (polar mletd2p (+ hgb agp) tieptuyen)
;;;;goc phan C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cgp (angtof gpc)
gkpc (/ (- pi cgp) 2) tanpc (/ (sin gkpc) (cos gkpc))
rpc (/ tieptuyen tanpc) lpctim (- (sqrt (+ (d:bp tieptuyen) (d:bp rpc))) rpc)
goc05c (cal "hgb + agp + bgp + cgp/2")
Pc (polar tam goc05c lpctim)
tengc (strcat "&#174;i n&#243;t giao " tenhgc)
tc1 (polar tam (+ hgb agp bgp cgp) tieptuyen)
mdgtd1t (polar td1 (+ hgb agp bgp (/ pi 2)) (/ bmatb_c 2))
mdgtd1p (polar td1 (+ hgb agp bgp (* (/ pi 2) -1)) (/ bmatb_c 2))
tamct (polar mdgtd1t (+ hgb agp bgp) tieptuyen)
tamcp (polar mdgtd1p (+ hgb agp bgp) tieptuyen)
mletd1t (polar td1 (+ hgb agp bgp (/ pi 2)) (+ (/ bmatb_c 2) bleb_c))
mletd1p (polar td1 (+ hgb agp bgp (* (/ pi 2) -1)) (+ (/ bmatb_c 2) bleb_c))
tamct1 (polar mletd1t (+ hgb agp bgp) tieptuyen)
tamcp1 (polar mletd1p (+ hgb agp bgp) tieptuyen)
;;;;goc phan D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dgp (angtof gpd)
gkpd (/ (- pi dgp) 2) tanpd (/ (sin gkpd) (cos gkpd))
rpd (/ tieptuyen tanpd) lpdtim (- (sqrt (+ (d:bp tieptuyen) (d:bp rpd))) rpd)
goc05d (cal "hgb + agp + bgp + cgp + dgp/2")
Pd (polar tam goc05d lpdtim)
tengd (strcat "&#174;i n&#243;t giao " tenhgd)
mdgtc1t (polar tc1 (+ hgb agp bgp cgp (/ pi 2)) (/ bmatd_c 2))
mdgtc1p (polar tc1 (+ hgb agp bgp cgp (* (/ pi 2) -1)) (/ bmatd_c 2))
tamdt (polar mdgtc1t (+ hgb agp bgp cgp) tieptuyen)
tamdp (polar mdgtc1p (+ hgb agp bgp cgp) tieptuyen)
mletc1t (polar tc1 (+ hgb agp bgp cgp (/ pi 2)) (+ (/ bmatd_c 2) bled_c))
mletc1p (polar tc1 (+ hgb agp bgp cgp (* (/ pi 2) -1)) (+ (/ bmatd_c 2) bled_c))
tamdt1 (polar mletc1t (+ hgb agp bgp cgp) tieptuyen)
tamdp1 (polar mletc1p (+ hgb agp bgp cgp) tieptuyen)
;;;;tinh tiep tuyen mep mat duong goc phan a;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gttpa (inters mdgtc2t tamat mdgtd2p tambp nil)
ttmdgpa (max (distance mdgtc2t gttpa) (distance mdgtd2p gttpa)) rmdpa (/ ttmdgpa tanpa)
mdgndpa_b (polar mdgtd2p (+ hgb agp) blea_B) mdgtta_b (polar gttpa (+ hgb agp) ttmdgpa)
mdgndpa_d (polar mdgtc2t hgb blea_d) mdgtta_d (polar gttpa hgb ttmdgpa)
lpamat (- (sqrt (+ (d:bp ttmdgpa) (d:bp rmdpa))) rmdpa) pamat (polar gttpa goc05a lpamat)
kcpt_pma (distance pa pamat)
;;;;tinh tiep tuyen mep le duong goc phan a;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gttpa1 (inters mletc2t tamat1 mletd2p tambp1 nil)
ttmlepa (max (distance mletc2t gttpa1) (distance mletd2p gttpa1)) rlepa (/ ttmlepa tanpa)
mlendpa_b (polar mletd2p (+ hgb agp) blea_B) mletta_b (polar gttpa1 (+ hgb agp) ttmlepa)
mlendpa_d (polar mletc2t hgb blea_d) mletta_d (polar gttpa1 hgb ttmlepa)
lpale (- (sqrt (+ (d:bp ttmlepa) (d:bp rlepa))) rlepa) pale (polar gttpa1 goc05a lpale)
);;;;;het setq;;;;;;;;;;;;;;;;


(setq
;;;;tinh tiep tuyen mep mat duong goc phan b;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gttpb (inters mdgtd2t tambt mdgtd1p tamcp nil)
ttmdgpb (max (distance mdgtd1p gttpb) (distance mdgtd2t gttpb)) rmdpb (/ ttmdgpb tanpb)
mdgndpb_c (polar mdgtd1p (+ hgb agp bgp) bleb_c) mdgttb_c (polar gttpb (+ hgb agp bgp) ttmdgpb)
mdgndta_b (polar mdgtd2t (+ hgb agp) blea_B) mdgtta_bt (polar gttpb (+ hgb agp) ttmdgpb)
lpbmat (- (sqrt (+ (d:bp ttmdgpb) (d:bp rmdpb))) rmdpb) pbmat (polar gttpb goc05b lpbmat)
kcpt_pmb (distance pb pbmat)
;;;;tinh tiep tuyen mep le duong goc phan b;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gttpb1 (inters mletd2t tambt1 mletd1p tamcp1 nil)
ttmlepb (max (distance mletd1p gttpb1) (distance mletd2t gttpb1)) rlepb (/ ttmlepb tanpb)
mlendpb_c (polar mletd1p (+ hgb agp bgp) bleb_c) mlettb_c (polar gttpb1 (+ hgb agp bgp) ttmlepb)
mlendta_b (polar mletd2t (+ hgb agp) blea_B) mletta_bt (polar gttpb1 (+ hgb agp) ttmlepb)
lpble (- (sqrt (+ (d:bp ttmlepb) (d:bp rlepb))) rlepb) pble (polar gttpb1 goc05b lpble)
);;;;;;;het setq;;;;;;;;;;;;;;;;

(setq
;;;;tinh tiep tuyen mep mat duong goc phan c;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gttpc (inters mdgtd1t tamct mdgtc1p tamdp nil)
ttmdgpc (max (distance mdgtd1t gttpc) (distance mdgtc1p gttpc)) rmdpc (/ ttmdgpc tanpc)
mdgndpd_c (polar mdgtc1p (+ hgb agp bgp cgp) bled_c) mdgttd_c (polar gttpc (+ hgb agp bgp cgp) ttmdgpc)
mdgndtb_c (polar mdgtd1t (+ hgb agp bgp) bleb_c) mdgttb_ct (polar gttpc (+ hgb agp bgp) ttmdgpc)
lpcmat (- (sqrt (+ (d:bp ttmdgpc) (d:bp rmdpc))) rmdpc) pcmat (polar gttpc goc05c lpcmat)
kcpt_pmc (distance pc pcmat)

;;;;tinh tiep tuyen mep le duong goc phan c;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gttpc1 (inters mletd1t tamct1 mletc1p tamdp1 nil)
ttmlepc (max (distance mletd1t gttpc1) (distance mletc1p gttpc1)) rlepc (/ ttmlepc tanpc)
mlendtd_c (polar mletc1p (+ hgb agp bgp cgp) bled_c) mlettd_ct (polar gttpc1 (+ hgb agp bgp cgp) ttmlepc)
mlendtb_c (polar mletd1t (+ hgb agp bgp) bleb_c) mlettb_ct (polar gttpc1 (+ hgb agp bgp) ttmlepc)
lpcle (- (sqrt (+ (d:bp ttmlepc) (d:bp rlepc))) rlepc) pcle (polar gttpc1 goc05c lpcle)
);;;;;;;het setq;;;;;;;;;;;;;;;;
(setq
;;;;tinh tiep tuyen mep mat duong goc phan d;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gttpd (inters mdgtc1t tamdt mdgtc2p tamap nil)
ttmdgpd (max (distance mdgtc2p gttpd) (distance mdgtc1t gttpd)) rmdpd (/ ttmdgpd tanpd)
mdgndta_d (polar mdgtc2p (+ hgb agp bgp cgp dgp) blea_d) mdgtta_dt (polar gttpd (+ hgb agp bgp cgp dgp) ttmdgpd)
mdgndtd_c (polar mdgtc1t (+ hgb agp bgp cgp) bled_c) mdgttd_ct (polar gttpd (+ hgb agp bgp cgp) ttmdgpd)
lpdmat (- (sqrt (+ (d:bp ttmdgpd) (d:bp rmdpd))) rmdpd) pdmat (polar gttpd goc05d lpdmat)
kcpt_pmd (distance pd pdmat)
;;;;tinh tiep tuyen mep le duong goc phan d;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gttpd1 (inters mletc1t tamdt1 mletc2p tamap1 nil)
ttmlepd (max (distance mletc2p gttpd1) (distance mletc1t gttpd1)) rlepd (/ ttmlepd tanpd)
mlendta_d (polar mletC2p (+ hgb agp bgp cgp dgp) blea_d) mletta_dt (polar gttpd1 (+ hgb agp bgp cgp dgp) ttmlepd)
mlendpd_c (polar mletc1t (+ hgb agp bgp cgp) bled_c) mlettd_cp (polar gttpd1 (+ hgb agp bgp cgp) ttmlepd)
lpdle (- (sqrt (+ (d:bp ttmlepd) (d:bp rlepd))) rlepd) pdle (polar gttpd1 goc05d lpdle)
);;;;;;;het setq;;;;;;;;;;;;;;;;
;;;;;;;;;;;;tinh cac diem cao do thiet ke trong nut;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (< (max lpatim lpbtim lpctim lpdtim) 5) (setq ip 2) (if (and (> (max lpatim lpbtim lpctim lpdtim) 5) (< (max lpatim lpbtim lpctim lpdtim) 10))
(setq ip 1.5) (setq ip 1)
);;;;;;;;;;;;het if
);;;;het if

(setq tkPa (cal "tktam + lpatim * ip/-100") tkPb (cal "tktam + lpbtim * ip/-100") tkPc (cal "tktam + lpctim * ip/-100") tkPd (cal "tktam + lpdtim * ip/-100")
tkPamat (cal "tkPa + kcpt_pma * imda/-100") tkPbmat (cal "tkPb + kcpt_pmb * imdb/-100")
tkPcmat (cal "tkPc + kcpt_pmc * imdc/-100") tkPdmat (cal "tkPd + kcpt_pmd * imdd/-100")
tktd2 (cal "tktam + tieptuyen * idocb/-100") tktd1 (cal "tktam + tieptuyen * idocc/-100")
tktc1 (cal "tktam + tieptuyen * idocd/-100") tktc2 (cal "tktam + tieptuyen * idoca/-100")
tkma (cal "tktc2 + (bmata_d/2) * imda/-100") tkmd (cal "tktc1 + (bmatd_c/2) * imdd/-100")
tkmb (cal "tktd2 + (bmata_b/2) * imdb/-100") tkmc (cal "tktd1 + (bmatb_c/2) * imdc/-100")

);;;;;het setq;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;tinh cac khoi luong via he;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (< ilea 0) (setq cbv (getreal "\nNhap chieu cao bo via (m): ") rbv (getreal "\nNhap be rong dinh bo via (m): ") chbv (getreal "\nNhap rong chan bo via (m): ")
Hda (getreal "\nNhap chieu day dem mong da dam bo via (m): ") kvh (getstring "\nNhap loai gach lat mat via he (Block/Creramit/beTong): ")
Hvhe (getreal "\nNhap chieu day gach lat via he(m): ") Hdvh (getreal "\nNhap chieu day dem mong via he(m): ")
Sdvh (strcat "&#167;&#214;m m&#227;ng v&#216;a h&#204; c&#184;t h&#185;t th&#171; " (rtos (cal "Hdvh*100")) "cm")
);;;;het setq;;;;;;;;;;;
(if (> ilea 0) (setq cbv 0l chbv 0 rbv 0 Hda 0 kvh 0 Hvhe 0 Hdvh 0 Sdvh 0))
);;;;;het if;;;;;;;;;;
(if (< ilea 0) (setq kcpt_plea (distance pale pamat) tkPale (cal "tkPamat + cbv + kcpt_plea * ilea/-100") tklb (cal "tkmb + cbv + blea_b * ileb/-100"))
(if (> ilea 0) (setq kcpt_plea (distance pale pamat) tkPale (cal "tkPamat + kcpt_plea * ilea/-100") tklb (cal "tkmb + blea_b * ileb/-100") cbv 0 chbv 0 rbv 0 )
);;;;;;het if;;;;;;;;

);;;het if;;;;;;;;;
(if (< ileb 0) (setq kcpt_pleb (distance pble pbmat) tkPble (cal "tkPbmat + cbv + kcpt_pleb * ileb/-100") tklc (cal "tkmc + cbv + bleb_c * ilec/-100"))
(if (> ileb 0) (setq kcpt_pleb (distance pble pbmat) tkPble (cal "tkPbmat + kcpt_pleb * ileb/-100") tklc (cal "tkmc + bleb_c * ilec/-100") cbv 0 chbv 0 rbv 0)
);;;;;;het if;;;;;;;;

);;;het if;;;;;;;;;
(if (< ilec 0) (setq kcpt_plec (distance pcle pcmat) tkPcle (cal "tkPcmat + cbv + kcpt_plec * ilec/-100") tkld (cal "tkmd + cbv + bled_c * iled/-100"))
(if (> ilec 0) (setq kcpt_plec (distance pcle pcmat) tkPcle (cal "tkPcmat + kcpt_plec * ilec/-100") tkld (cal "tkmd + bled_c * iled/-100") cbv 0 chbv 0 rbv 0)
);;;;;;het if;;;;;;;;

);;;het if;;;;;;;;;
(if (< iled 0) (setq kcpt_pled (distance pdle pdmat) tkPdle (cal "tkPdmat + cbv + kcpt_pled * iled/-100") tkla (cal "tkma + cbv + blea_d * ilea/-100"))
(if (> iled 0) (setq kcpt_pled (distance pdle pdmat) tkPdle (cal "tkPdmat + kcpt_pled * iled/-100") tkla (cal "tkmd + blea_d * ilea/-100") cbv 0 chbv 0 rbv 0)
);;;het if;;;;;;;;;

);;;het if;;;;;;;;;
;;;;;Ve tim nut 4 goc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setq goca hgb gocb (+ hgb agp) gocc (+ hgb agp bgp) gocd (+ hgb agp bgp cgp)
xetm "vmat" xetl "vle"
);;;;;;;;;;;het setq
;;;;;;;;;;;ham ve duong cong khi co hai goc < 180d
(defun d:g2p(g1 g2 g3 p1 p2)
(setq g2c (cal "ang(tam,p2,p1)") g2c (d:rad g2c) gch (cal "pi-g2c") )
(if (and (< g2c pi) (> gch (cal "cvunit(2d,degree,radian)")) (< gch (cal "cvunit(45d,degree,radian)")))
(progn
(setq g2ca (cal "gch/2") tan2pca (/ (sin g2ca) (cos g2ca))
rp2ca (/ tieptuyen tan2pca) lp2ca (- (sqrt (+ (d:bp tieptuyen) (d:bp rp2ca))) rp2ca)
gq (cal "ang(tam,p2,p1)/2") q1 (cal "pld(tam,p2,lp2ca)") 2Pca (cal "rot(q1,tam,gq)")
);;;;;;;;;het setq;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(command "zoom" "C" tam 5 "-layer" "s" "timdg" "" "arc" p1 "E" p2 "R" rp2ca)
(setq r (* rp2ca 100) r (rtos r) r (strcat "r" r))
(command "-layer" "s" kt "" "QLEADER" 2Pca (polar 2Pca (d:rad 10) 2) "" r "")
)
);;;;;;;;;;het if;;;;;;;;;;;;;;;;;;;;;;;;;;;;
);;;;;;;het ham;;;;;;;;;;;;;;;;;;;;;;;;;;
(d:vtim tam tc2 td2 Pa goca blea_d tktc2 tkPa rpa) (d:g2p goca gocc goca td1 tc2)
(d:vtim tam td2 td1 Pb gocb blea_b tktd2 tkPb rpb) (d:g2p gocb gocd gocb tc1 td2)
(d:vtim tam td1 tc1 Pc gocc bleb_c tktd1 tkPc rpc) (d:g2p gocc goca gocc tc2 td1)
(d:vtim tam tc1 tc2 Pd gocd bled_c tktc1 tkPd rpd) (d:g2p gocd gocb gocd td2 tc1)
(command "-layer" "s" "cdtk" "" "text" "s" tle "j" "c" tam 0 (rtos tktam) "zoom" "c" tam 2)
;;;;;;het ve tim 4 goc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;ve mep mat duong 4 goc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(d:vmat mdgndpa_b mdgtta_b Pamat mdgtta_d mdgndpa_d rmdpa xetm tkmb tkPamat tkma )
(d:vmat mdgndpb_c mdgttb_c Pbmat mdgtta_bt mdgndta_b rmdpb xetm tkmc tkPbmat tkmb )
(d:vmat mdgndpd_c mdgttd_c Pcmat mdgttb_ct mdgndtb_c rmdpc xetm tkmd tkPcmat tkmc )
(d:vmat mdgndta_d mdgtta_dt Pdmat mdgttd_ct mdgndtd_c rmdpd xetm tkma tkPdmat tkmd )
(defun d:para(gc gk gk2 P pt1 pt2 pt3 pt4)
(if (and (> rbv 0) (> chbv 0))
(progn
(setq gk (cal "gk + pi/2") gk2 (cal "gk2 + pi/2")
ssg1a (polar P gc rbv) pt1t (polar pt1 gk2 (cal "-1 * rbv")) pt2t (polar pt2 gk2 (cal "-1 * rbv")) pt3t (polar pt3 gk rbv) pt4t (polar pt4 gk rbv)
ssg2a (polar P gc (cal "-1 * chbv")) pt1p (polar pt1 gk2 chbv) pt2p (polar pt2 gk2 chbv) pt3p (polar pt3 gk (cal "-1 * chbv")) pt4p (polar pt4 gk (cal "-1 * chbv"))
);;;;het setq;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(command "zoom" "c" tam 4
"-layer" "s" "bovia" "" "pline" pt1t pt2t "A" "S" ssg1a pt3t "L" pt4t "" "pline" pt1p pt2p "A" "S" ssg2a pt3p "L" pt4p ""

"zoom" "C" tam 4
);;;;het com;;;;;;;;;;;;;;;;;;;
);;;het progn;;;;;;;;;;;;;;;;;;

);;;;het if;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
);;;;het ham;;;;;;;;;;;;;;;;;;;;;
(d:para goc05a goca gocb Pamat mdgndpa_b mdgtta_b mdgtta_d mdgndpa_d)
(d:para goc05b gocb gocc Pbmat mdgndpb_c mdgttb_c mdgtta_bt mdgndta_B)
(d:para goc05c gocc gocd Pcmat mdgndpd_c mdgttd_c mdgttb_ct mdgndtb_c)
(d:para goc05d gocd goca Pdmat mdgndta_d mdgtta_dt mdgttd_ct mdgndtd_c)
;;;;het ve mep mat duong;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;ve mep le duong 4 goc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(d:vmat mlendpa_b mletta_b Pale mletta_d mlendpa_d rlepa xetl tklb tkPale tkla)
(d:vmat mlendpb_c mlettb_c Pble mletta_bt mlendta_b rlepb xetl tklc tkPble tklb)
(d:vmat mlendtd_c mlettd_ct Pcle mlettb_ct mlendtb_c rlepc xetl tkld tkPcle tklc)
(d:vmat mlendta_d mletta_dt Pdle mlettd_cp mlendpd_c rlepd xetl tkla tkPdle tkld)
;;;;het ve mep le duong;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;ve 4 mui ten chi huong;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(muiten mlendpa_d mlendta_d goca mdgndpa_d mdgndta_d Pa td2 tc2 tenga)
(command "text" "s" tle "j" "c" (list (car d9) (+ (cadr d9) 2.5)) 0 (strcat "b&#215;nh &#174;&#229; n&#243;t giao th&#171;ng " ten " " ltrh)
"scale" "last" "" (list (car d9) (+ (cadr d9) 2.5)) 2.0
)
(muiten mlendta_b mlendpa_b gocb mdgndta_b mdgndpa_b Pb td1 td2 tengb)
(muiten mlendtb_c mlendpb_c gocc mdgndtb_c mdgndpb_c Pc tc1 td1 tengc)
(muiten mlendpd_c mlendtd_c gocd mdgndtd_c mdgndpd_c Pd tc2 tc1 tengd)
;;;;het ve mui ten chi huong;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;ve 4 pham vi nut & to via he;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(d:vpvn mlendpa_d mletta_d mlendta_d mletta_dt goca bmata_d blea_d tam tc2)
(d:vpvn mlendpa_b mletta_b mlendta_b mletta_bt gocb bmata_b blea_b tam td2)
(d:vpvn mlendpb_c mlettb_c mlendtb_c mlettb_ct gocc bmatb_c bleb_c tam td1)
(d:vpvn mlendpd_c mlettd_cp mlendtd_c mlettd_ct gocd bmatd_c bled_c tam tc1)

(defun d:tovh(gc5 P ble)
(setq dto (polar P gc5 1))
(if (< ilea 0) (command "zoom" "W" (list (- (car P) 40) (+ (cadr P) 40)) tam "-layer" "s" "toviahe" ""
"-layer" "off" "pvtknut" "" "-hatch" "P" "ar-hbone" 0.005 0 dto "" "-layer" "on" "pvtknut" "")
);;;;;;;;
);;;;;het ham;;;;;;;;;;;;;;;
(d:tovh goc05a Pamat blea_d)
(d:tovh goc05b Pbmat blea_B)
(d:tovh goc05c Pcmat bleb_c)`
(d:tovh goc05d Pdmat bled_c)
;;;;het ve pham vi nut;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;ve ten c&#228;c;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq
tcoc4 (polar tc2 (cal "1.5708+goca") (cal "bmata_d/2 + blea_d+1" )) tcoc1 (polar td2 (cal "1.5708+gocb") (cal "bmata_b/2 + blea_b+1" ))
tcoc3 (polar td1 (cal "1.5708+gocc") (cal "bmatb_c/2 + bleb_c+1" )) tcoc2 (polar tc1 (cal "1.5708+gocd") (cal "bmatd_c/2 + bled_c+1" ))
tcocPa (polar Pa (cal "0+goc05a") (cal "bmata_d/2 + blea_d+1" )) tcocPb (polar Pb (cal "0+goc05b") (cal "bmata_b/2 + blea_b+1" ))
tcocPc (polar Pc (cal "0+goc05c") (cal "bmatb_c/2 + bleb_c+1" )) tcocPd (polar Pd (cal "0+goc05d") (cal "bmatd_c/2 + bled_c+1" ))
);;;;;;;;;;;het setq
(command "zoom" "c" tam 4 "-layer" "s" "tencoc" ""
"line" tcoc4 (polar tcoc4 (cal "1.5708+goca") 1.) "" "text" "c" (polar tcoc4 (cal "1.5708+goca") 1.5) (d:do goca) (strcat "tc' " ten) ""
"line" tcocPa (polar tcocPa goc05a 1.) "" "text" "c" (polar tcocPa goc05a 2) (cal "1.5708+goc05a") "Pa" ""
"line" tcoc1 (polar tcoc1 (cal "1.5708+gocb") 1.) "" "text" "c" (polar tcoc1 (cal "1.5708+gocb") 1.5) (d:do (+ gocb pi)) (strcat "td " ten) ""
"line" tcocPb (polar tcocPb goc05b 1.0) "" "text" "c" (polar tcocPb goc05b 2) (cal "1.5708+goc05b") "Pb" ""
"line" tcoc3 (polar tcoc3 (cal "1.5708+gocc") 1.) "" "text" "c" (polar tcoc3 (cal "1.5708+gocc") 1.5) (d:do gocc) (strcat "td' " ten) ""
"line" tcocPc (polar tcocPc goc05c 1.) "" "text" "c" (polar tcocPc goc05c 2) (cal "1.5708+goc05c") "Pc" ""
"line" tcoc2 (polar tcoc2 (cal "1.5708+gocd") 1.) "" "text" "c" (polar tcoc2 (cal "1.5708+gocd") 1.5) (d:do gocd) (strcat "tc " ten) ""
"line" tcocPd (polar tcocPd goc05d 1.) "" "text" "c" (polar tcocPd goc05d 2) (cal "1.5708+goc05d") "Pd" ""

);;;;;;;;het com;;;;;;;;;;;;;;;;;;
;;;;het ve ten c&#228;c;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;ve bang yeu to cong;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq dgbg (list (+ (car tamat) (cal "tieptuyen * 1.1")) (cadr tamat))
dcga (polar dgbg (d:rad 90) (cal "tieptuyen + 1"))
gtl (polar dcga 0 -1) gtl1 (polar gtl 0 2) gtl2 (polar gtl1 0 3.2) gtl3 (polar gtl2 0 2)
gtl4 (polar gtl3 0 2) gtl5 (polar gtl4 0 2) gtr (polar gtl 0 13.2)
dct (list (+ (car gtl) 1) (- (cadr gtl) 0.4) 0) dc1 (polar dct 0 2.6) dc2 (polar dc1 0 2.6)
dc3 (polar dc2 0 2) dc4 (polar dc3 0 2) dc5 (polar dc4 0 2)
dmsa (d:dms agp) dmsb (d:dms bgp) dmsc (d:dms cgp) dmsd (d:dms dgp) tt (rtos tieptuyen)
ra (rtos rpa) rb (rtos rpb) rc (rtos rpc) rd (rtos rpd) lpa (rtos lpatim) lpb (rtos lpbtim) lpc (rtos lpctim) lpd (rtos lpdtim)
agp (- (d:rad 180) agp) bgp (- (d:rad 180) bgp) cgp (- (d:rad 180) cgp) dgp (- (d:rad 180) dgp)
ka (rtos (* rpa agp)) kb (rtos (* rpb bgp)) kc (rtos (* rpc cgp)) kd (rtos (* rpd dgp))
);;;;het tinh ve bang;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(command "zoom" "c" tam 30 "regen" "-layer" "s" "bggoc" "" "line" gtl gtr "" "-array" "l" "" "r" "6" 1 -0.8
"line" gtl (polar gtl (d:rad -90) 4) "" "line" gtl1 (polar gtl1 (d:rad -90) 4) ""
"line" gtl2 (polar gtl2 (d:rad -90) 4) "" "line" gtl3 (polar gtl3 (d:rad -90) 4) ""
"line" gtl4 (polar gtl4 (d:rad -90) 4) "" "line" gtl5 (polar gtl5 (d:rad -90) 4) "" "line" gtr (polar gtr (d:rad -90) 4) ""

"text" "s" "chu1-200" "j" "mc" dct 0 "&#174;&#216;nh" "" "text" "j" "mc" dc1 0 "g&#227;c a" "" "text" "j" "mc" dc2 0 "t" ""
"text" "j" "mc" dc3 0 "r" "" "text" "j" "mc" dc4 0 "p" "" "text" "j" "mc" dc5 0 "k" ""
"text" "j" "mc" (polar dct (d:rad -90) 0.8) 0 "pa" "text" "j" "mc" (polar dc1 (d:rad -90) 0.8) 0 dmsa
"text" "j" "mc" (polar dc2 (d:rad -90) 0.8) 0 tt "text" "j" "mc" (polar dc3 (d:rad -90) 0.8) 0 ra
"text" "j" "mc" (polar dc4 (d:rad -90) 0.8) 0 lpa "text" "j" "mc" (polar dc5 (d:rad -90) 0.8) 0 ka
"text" "j" "mc" (polar dct (d:rad -90) 1.6) 0 "pb" "text" "j" "mc" (polar dc1 (d:rad -90) 1.6) 0 dmsb
"text" "j" "mc" (polar dc2 (d:rad -90) 1.6) 0 tt "text" "j" "mc" (polar dc3 (d:rad -90) 1.6) 0 rb
"text" "j" "mc" (polar dc4 (d:rad -90) 1.6) 0 lpb "text" "j" "mc" (polar dc5 (d:rad -90) 1.6) 0 kb
"text" "j" "mc" (polar dct (d:rad -90) 2.4) 0 "pc" "text" "j" "mc" (polar dc1 (d:rad -90) 2.4) 0 dmsc
"text" "j" "mc" (polar dc2 (d:rad -90) 2.4) 0 tt "text" "j" "mc" (polar dc3 (d:rad -90) 2.4) 0 rc
"text" "j" "mc" (polar dc4 (d:rad -90) 2.4) 0 lpc "text" "j" "mc" (polar dc5 (d:rad -90) 2.4) 0 kc
"text" "j" "mc" (polar dct (d:rad -90) 3.2) 0 "pd" "text" "j" "mc" (polar dc1 (d:rad -90) 3.2) 0 dmsd
"text" "j" "mc" (polar dc2 (d:rad -90) 3.2) 0 tt "text" "j" "mc" (polar dc3 (d:rad -90) 3.2) 0 rd
"text" "j" "mc" (polar dc4 (d:rad -90) 3.2) 0 lpd "text" "j" "mc" (polar dc5 (d:rad -90) 3.2) 0 kd
"text" "j" "mc" (list (+ (car gtl) 6.6) (+ (cadr gtl) 0.7)) 0 "b&#182;ng y&#213;u t&#232; &#174;&#173;&#234;ng cong trong n&#243;t"
);;;;;het com;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;het ve bang yeu to cong;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;ve bang toa do cac diem;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;tinh cac diem ve bang toa do;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq
gtd (list (+ (car dgbg) 1) (+ (cadr dgbg) -1)) gtd1 (polar gtd 0 3) gtd2 (polar gtd1 0 4) gtd3 (polar gtd2 0 4) gtd4 (polar gtd3 0 3)
gtd5 (polar gtd4 0 3) gtd6 (polar gtd5 0 4) gtd7 (polar gtd6 0 4) gtd8 (polar gtd7 0 3)
dctd (list (+ (car gtd) 1.5) (- (cadr gtd) 0.4)) dctd1 (polar dctd 0 3.5) dctd2 (polar dctd1 0 4) dctd3 (polar dctd2 0 3.5) dctd4 (polar dctd3 0 3)
dctd5 (polar dctd4 0 3.5) dctd6 (polar dctd5 0 4) dctd7 (polar dctd6 0 3.5)
);;;;;het setq;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(command "-layer" "s" "bgtoado" "" "line" gtd gtd8 "" "line" (polar gtd1 (d:rad -90) 0.8) (polar gtd4 (d:rad -90) 0.8) ""
"line" (polar gtd5 (d:rad -90) 0.8) (polar gtd8 (d:rad -90) 0.8) "" "line" (polar gtd (d:rad -90) 1.6) (polar gtd8 (d:rad -90) 1.6) ""
"-array" "l" "" "r" "18" 1 -0.8 "text" "j" "c" (polar gtd4 (d:rad 90) 0.8) 0 "b&#182;ng th&#232;ng k&#170; t&#228;a &#174;&#233; c&#184;c &#174;i&#211;m thi&#213;t k&#213;" "" "scale" "l" "" (polar gtd4 (d:rad 90) 0.8) 1.5
"line" gtd (polar gtd (d:rad -90) 15.2) "" "line" gtd1 (polar gtd1 (d:rad -90) 15.2) "" "line" (polar gtd2 (d:rad -90) 0.8) (polar gtd2 (d:rad -90) 15.2) ""
"line" (polar gtd3 (d:rad -90) 0.8) (polar gtd3 (d:rad -90) 15.2) "" "line" gtd4 (polar gtd4 (d:rad -90) 15.2) "" "line" gtd5 (polar gtd5 (d:rad -90) 15.2) ""
"line" (polar gtd6 (d:rad -90) 0.8) (polar gtd6 (d:rad -90) 15.2) "" "line" (polar gtd7 (d:rad -90) 0.8) (polar gtd7 (d:rad -90) 15.2) ""
"line" gtd8 (polar gtd8 (d:rad -90) 15.2) "" "text" "s" "chu1-200" "j" "mc" dctd 0 "t&#170;n" "" "text" "j" "mc" (polar dctd 0 7) 0 "t&#228;a &#174;&#233; c&#184;c &#174;i&#211;m thi&#213;t k&#213;" ""
"text" "j" "mc" dctd4 0 "t&#170;n" "" "text" "j" "mc" (polar dctd4 0 7) 0 "t&#228;a &#174;&#233; c&#184;c &#174;i&#211;m thi&#213;t k&#213;" ""
"text" "j" "mc" (polar dctd (d:rad -90) 0.8) 0 "&#174;i&#211;m" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 0.8) 0 "x" ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 0.8) 0 "y" "" "text" "j" "mc" (polar dctd3 (d:rad -90) 0.8) 0 "z" ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 0.8) 0 "&#174;i&#211;m" "" "text" "j" "mc" (polar dctd5 (d:rad -90) 0.8) 0 "x" ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 0.8) 0 "y" "" "text" "j" "mc" (polar dctd7 (d:rad -90) 0.8) 0 "z" ""
"text" "j" "mc" (polar dctd (d:rad -90) 1.6) 0 ten "" "text" "j" "mc" (polar dctd1 (d:rad -90) 1.6) 0 (rtos (cadr tam) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 1.6) 0 (rtos (car tam) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 1.6) 0 (rtos tktam 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 2.4) 0 "Pa" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 2.4) 0 (rtos (cadr Pa) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 2.4) 0 (rtos (car Pa) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 2.4) 0 (rtos tkPa 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 3.2) 0 "mdPa" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 3.2) 0 (rtos (cadr Pamat) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 3.2) 0 (rtos (car Pamat) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 3.2) 0 (rtos tkPamat 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 4.0) 0 "mlPa" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 4.0) 0 (rtos (cadr Pale) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 4.0) 0 (rtos (car Pale) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 4.0) 0 (rtos tkPale 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 4.8) 0 "Pb" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 4.8) 0 (rtos (cadr Pb) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 4.8) 0 (rtos (car Pb) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 4.8) 0 (rtos tkPb 2 2) ""
"zoom" "c" (polar gtd4 (d:rad -90) 5.6) 8
"text" "j" "mc" (polar dctd (d:rad -90) 5.6) 0 "mdPb" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 5.6) 0 (rtos (cadr Pbmat) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 5.6) 0 (rtos (car Pbmat) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 5.6) 0 (rtos tkPbmat 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 6.4) 0 "mlPb" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 6.4) 0 (rtos (cadr Pble) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 6.4) 0 (rtos (car Pble) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 6.4) 0 (rtos tkPble 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 7.2) 0 "Pc" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 7.2) 0 (rtos (cadr Pc) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 7.2) 0 (rtos (car Pc) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 7.2) 0 (rtos tkPc 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 8.0) 0 "mdPc" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 8.0) 0 (rtos (cadr Pcmat) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 8.0) 0 (rtos (car Pcmat) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 8.0) 0 (rtos tkPcmat 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 8.8) 0 "mlPc" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 8.8) 0 (rtos (cadr Pcle) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 8.8) 0 (rtos (car Pcle) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 8.8) 0 (rtos tkPcle 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 9.6) 0 "Pd" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 9.6) 0 (rtos (cadr Pd) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 9.6) 0 (rtos (car Pd) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 9.6) 0 (rtos tkPd 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 10.4) 0 "mdPd" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 10.4) 0 (rtos (cadr Pdmat) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 10.4) 0 (rtos (car Pdmat) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 10.4) 0 (rtos tkPdmat 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 11.2) 0 "mlPd" "" "text" "j" "mc" (polar dctd1 (d:rad -90) 11.2) 0 (rtos (cadr Pdle) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 11.2) 0 (rtos (car Pdle) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 11.2) 0 (rtos tkPdle 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 12) 0 (strcat "td" ten) "" "text" "j" "mc" (polar dctd1 (d:rad -90) 12) 0 (rtos (cadr td2) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 12) 0 (rtos (car td2) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 12) 0 (rtos tktd2 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 12.8) 0 (strcat "mdt-td" ten) "" "text" "j" "mc" (polar dctd1 (d:rad -90) 12.8) 0 (rtos (cadr mdgtd2p) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 12.8) 0 (rtos (car mdgtd2p) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 12.8) 0 (rtos tkmb 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 13.6) 0 (strcat "mdp-td" ten) "" "text" "j" "mc" (polar dctd1 (d:rad -90) 13.6) 0 (rtos (cadr mdgtd2t) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 13.6) 0 (rtos (car mdgtd2t) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 13.6) 0 (rtos tkmb 2 2) ""
"text" "j" "mc" (polar dctd (d:rad -90) 14.4) 0 (strcat "mlt-td" ten) "" "text" "j" "mc" (polar dctd1 (d:rad -90) 14.4) 0 (rtos (cadr mletd2p) 2 4) ""
"text" "j" "mc" (polar dctd2 (d:rad -90) 14.4) 0 (rtos (car mletd2p) 2 4) "" "text" "j" "mc" (polar dctd3 (d:rad -90) 14.4) 0 (rtos tklb 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 1.6) 0 (strcat "mlp-td" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 1.6) 0 (rtos (cadr mletd2t) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 1.6) 0 (rtos (car mletd2t) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 1.6) 0 (rtos tklb 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 2.4) 0 (strcat "tc" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 2.4) 0 (rtos (cadr tc1) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 2.4) 0 (rtos (car tc1) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 2.4) 0 (rtos tktc1 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 3.2) 0 (strcat "mdt-tc" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 3.2) 0 (rtos (cadr mdgtc1t) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 3.2) 0 (rtos (car mdgtc1t) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 3.2) 0 (rtos tkmd 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 4.0) 0 (strcat "mdp-tc" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 4.0) 0 (rtos (cadr mdgtc1p) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 4.0) 0 (rtos (car mdgtc1p) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 4.0) 0 (rtos tkmd 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 4.8) 0 (strcat "mlt-tc" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 4.8) 0 (rtos (cadr mletc1t) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 4.8) 0 (rtos (car mletc1t) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 4.8) 0 (rtos tkld 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 5.6) 0 (strcat "mlp-tc" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 5.6) 0 (rtos (cadr mletc1p) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 5.6) 0 (rtos (car mletc1p) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 5.6) 0 (rtos tkld 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 6.4) 0 (strcat "td'" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 6.4) 0 (rtos (cadr td1) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 6.4) 0 (rtos (car td1) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 6.4) 0 (rtos tktd1 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 7.2) 0 (strcat "mdt-td'" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 7.2) 0 (rtos (cadr mdgtd1p) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 7.2) 0 (rtos (car mdgtd1p) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 7.2) 0 (rtos tkmc 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 8.0) 0 (strcat "mdp-td'" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 8.0) 0 (rtos (cadr mdgtd1t) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 8.0) 0 (rtos (car mdgtd1t) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 8.0) 0 (rtos tkmc 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 8.8) 0 (strcat "mlt-td'" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 8.8) 0 (rtos (cadr mletd1p) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 8.8) 0 (rtos (car mletd1p) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 8.8) 0 (rtos tklc 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 9.6) 0 (strcat "mlp-td'" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 9.6) 0 (rtos (cadr mletd1t) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 9.6) 0 (rtos (car mletd1t) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 9.6) 0 (rtos tklc 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 10.4) 0 (strcat "tc'" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 10.4) 0 (rtos (cadr tc2) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 10.4) 0 (rtos (car tc2) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90)10.4) 0 (rtos tktc2 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 11.2) 0 (strcat "mdt-tc'" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 11.2) 0 (rtos (cadr mdgtc2t) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 11.2) 0 (rtos (car mdgtc2t) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 11.2) 0 (rtos tkma 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 12.0) 0 (strcat "mdp-tc'" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 12.0) 0 (rtos (cadr mdgtc2p) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 12.0) 0 (rtos (car mdgtc2p) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 12.0) 0 (rtos tkma 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 12.8) 0 (strcat "mlt-tc'" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 12.8) 0 (rtos (cadr mletc2t) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 12.8) 0 (rtos (car mletc2t) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 12.8) 0 (rtos tkla 2 2) ""
"text" "j" "mc" (polar dctd4 (d:rad -90) 13.6) 0 (strcat "mlp-tc'" ten) "" "text" "j" "mc" (polar dctd5 (d:rad -90) 13.6) 0 (rtos (cadr mletc2p) 2 4) ""
"text" "j" "mc" (polar dctd6 (d:rad -90) 13.6) 0 (rtos (car mletc2p) 2 4) "" "text" "j" "mc" (polar dctd7 (d:rad -90) 13.6) 0 (rtos tkla 2 2) ""
);;;;;;het com;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;het ve bang toa do diem;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;tinh chon dien tich nen mat duong trong nut;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq lua (ssget "x" '( (-4 . "<OR") (8 . "meple")
(8 . "pvtknut")
(-4 . "OR>") )
)
);;;;;het setq
(command "_layiso" lua "")
(command "zoom" "w" (polar tam 1.5708 44) (polar tam -1.5708 44))
(command "-BOUNDARY" tam "")
(command "area" "O" "L" "layon")
(setq dtnd (getvar "area") cvnd (getvar "PERIMETER"))
(setq lua1 (ssget "x" '( (-4 . "<OR") (8 . "mepdg")
(8 . "pvtknut")
(-4 . "OR>") )
)
);;;;;het setq
(command "_layiso" lua1 "")
(command "zoom" "w" (polar tam 1.5708 44) (polar tam -1.5708 44))
(command "-BOUNDARY" tam "")
(command "area" "O" "L" "layon")
(setq dtmd (getvar "area") cvmd (getvar "PERIMETER"))
;;;;;tinh cac diem bang khoi luong;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq dgbgkl (list (+ (car dgbg) 12) (- (cadr dgbg) 18))
dg1 (list (- (car dgbgkl) 9.75) (- (cadr dgbgkl) 1)) dg2 (polar dg1 0 1.5) dg3 (polar dg2 0 14) dg4 (polar dg3 0 4)
dg1x (polar dg1 (d:rad -90) 1.2) dg4x (polar dg4 (d:rad -90) 1.2)
dg1xs (polar dg1x (d:rad -90) 16) dg4xs (polar dg4x (d:rad -90) 16)
dg2x (polar dg2 (d:rad -90) 17.2) dg3x (polar dg3 (d:rad -90) 17.2)
chu1 (list (+ (car dg1) 0.75) (- (cadr dg1) 0.60)) chu2 (list (+ (car dg2) 6) (- (cadr dg2) 0.60))
chu3 (list (+ (car dg3) 2) (- (cadr dg3) 0.60)) chu4 (list (+ (car dg1x) 2) (- (cadr chu1) 0))
Lbv (cal "cvmd - bmata_b - bmata_d - bmatb_c - bmatd_c")
Sbv (cal "(cbv + 0.05)*0.5*rbv + 0.21*(rbv+chbv)") Vbv (cal "Sbv*Lbv") Svkbv (cal "Lbv*(cbv+0.47) + 2*Sbv")
dadambv (cal "(chbv+rbv)*Lbv*Hda") dtmd (cal "dtmd - Lbv*chbv") Svhe (cal "dtnd - dtmd - Lbv*(rbv+chbv)")

);;;;;;;;;;het stq
(if (< ilea 0)
(if (= kvh "b") (setq Slatvh (strcat "V&#216;a h&#204; l&#184;t g&#185;ch Block " (rtos (cal "Hvhe*100")) "cm")
);;;;het setq;;;;;;;;;;;
(if (= kvh "c") (setq Slatvh (strcat "V&#216;a h&#204; l&#184;t g&#185;ch c&#173;&#234;ng &#174;&#233; cao " (rtos (cal "Hvhe*100")) "cm")
);;;;;;;het setq
(if (= kvh "t") (setq Slatvh (strcat "V&#216;a h&#204; l&#184;t b&#170; t&#171;ng xi m&#168;ng m200 &#174;&#184; 1x2 " (rtos (cal "Hvhe*100")) "cm")
);;;;;;;het setq
);;;;;het if 1;;;;;;
);;;;het if 2;;;;;;;;;;;
);;;;;het if 3;;;;;;;;;;
);;;;het if 4

(defun d:adgc(dtmd)
(if (= dtmd nil) (setq dtmd (getvar "area")))
(if dtmd (setq dlop1 (getreal "\nNhap chieu day lop BTXM - M250(m): ") dlop2 (getreal "\nNhap chieu day lop dem da dam(m): ")
dlopk1 (getreal "\nNhap chieu day lop dat doi soi dam k=1(m): ") khdg (cal "dtmd*(dlop1+dlop2+dlopk1)")
kllopK1 (cal "dlopK1*dtmd") kllop3 (strcat (rtos kllopK1) "m3") klthep (cal "(7850*pi*(0.025)^2/4)*(dtmd/25)*4*0.25")
klmatit (cal "((dtmd/25)*2*5*0.02*0.01)*1600") tklmatit (strcat (rtos klmatit) "kg") tklth (strcat (rtos klthep) "kg")
tlop1 (strcat "l&#237;p b&#170; t&#171;ng xi m&#168;ng m250 d&#181;y " (rtos (cal "dlop1*100")) "cm") tlop2 (strcat "l&#237;p &#174;&#214;m &#174;&#184; d&#168;m d&#181;y " (rtos (cal "dlop2*100")) "cm")
tlop3 (strcat "l&#237;p &#174;&#202;t &#174;&#229;i s&#225;i &#174;&#199;m k=1 d&#181;y " (rtos (cal "dlopk1*100")) "cm") tlop4 "th&#208;p d25 l&#181;m khe co gi&#183;n" tlop5 "m&#184;t t&#221;t nh&#249;a &#174;&#173;&#234;ng"
);;;;;;;;;;;;;het setq
);;;;het if;;;;;;;;;;;

);;;;;;het ham

(defun d:adgm(dt k)
(if (= dtmd nil) (setq dtmd (getvar "area")))
(if dtmd (setq kca (getstring "\nThiet ke ao duong mem A1 hay A2 (A1/A2)?:"))
);;;;;het if;;;;;;;;;;;
(if (and (= keykc "M") (= kca "a1"))
(if (or (not tlop5) tlop5)
(setq dlop1 (getreal "\nNhap chieu day lop BTN hat min(m): ") dlop2 (getreal "\nNhap chieu day lop BTN hat tho(m): ")
dlop3 (getreal "\nNhap chieu day lop cap phoi da dam (m): ") dlopk1 (getreal "\nNhap chieu day lop dat doi soi dam k=1(m): ")
khdg (cal "dtmd*(dlop1+dlop2+dlop3+dlopk1)") tlop1 (strcat "l&#237;p b&#170; t&#171;ng nh&#249;a h&#185;t m&#222;n d&#181;y " (rtos (cal "dlop1*100")) "cm")
tlop2 (strcat "l&#237;p b&#170; t&#171;ng nh&#249;a h&#185;t th&#171; d&#181;y " (rtos (cal "dlop2*100")) "cm") tlop3 "t&#173;&#237;i nh&#249;a d&#221;nh b&#184;m tr&#170;n m&#198;t CP&#167;D 0.5kg/m2"
tlop4 (strcat "l&#237;p c&#202;p ph&#232;i &#174;&#184; d&#168;m d&#181;y " (rtos (cal "dlop3*100")) "cm") kllopK1 (cal "dlopK1*dtmd") kllop5 (strcat (rtos kllopK1) "m3")
tlop5 (strcat "l&#237;p &#174;&#202;t &#174;&#229;i s&#225;i &#174;&#199;m k=1 d&#181;y " (rtos (cal "dlopk1*100")) "cm")
);;;;het setq
);;;;het if
);;;;het if;;;;;;;;;;
(if (and (= keykc "M") (= kca "a2"))
(if (or (not tlop5) tlop5)
(setq dlop1 (getreal "\nNhap chieu day lop BTN hat trung(m): ")
dlop2 (getreal "\nNhap chieu day lop cap phoi da dam (m): ") dlopk1 (getreal "\nNhap chieu day lop dat doi soi dam k=1(m): ")
khdg (cal "dtmd*(dlop1+dlop2+dlopk1)") tlop1 (strcat "l&#237;p b&#170; t&#171;ng nh&#249;a h&#185;t trung d&#181;y " (rtos (cal "dlop1*100")) "cm")

tlop2 "t&#173;&#237;i nh&#249;a d&#221;nh b&#184;m tr&#170;n m&#198;t CP&#167;D 0.5kg/m2"
tlop3 (strcat "l&#237;p c&#202;p ph&#232;i &#174;&#184; d&#168;m d&#181;y " (rtos (cal "dlop2*100")) "cm") kllopK1 (cal "dlopK1*dtmd") kllop4 (strcat (rtos kllopK1) "m3")
tlop4 (strcat "l&#237;p &#174;&#202;t &#174;&#229;i s&#225;i &#174;&#199;m k=1 d&#181;y " (rtos (cal "dlopk1*100")) "cm")
tlop5 nil kllop5 nil
);;;;het setq
);;;;het if

);;;;;het if;;;;;;;;;
);;;;;het ham;;;;;;;;;;
(initget 128 "M C")
(setq keykc (getkword "\nThiet ke ao duong mem hay cung (M/C)?:"))
(cond ((= keykc "M") (d:adgm dtmd keykc)) ((= keykc "C") (d:adgc dtmd)))
;;;;;;tinh khoi luong dao hoac dap nen duong;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq cdtnhien (getreal "\nNhap vao cao do tu nhien trong pham vi nut tinh binh quan: ")
sumcdtkbq (cal "(tktam+tktd1+tktd2+tktc1+tktc2+tkPa+tkPb+tkPc+tkPd+tkPamat+tkPbmat+tkPcmat+tkPdmat+tkma+tkmb+tkmc+tkmd+tkPale+tkPble+tkPcle+tkPdle+tkla+tklb+tklc+tkld)/25")
chcaodo (cal "sumcdtkbq - cdtnhien")
);;;;het setq;;;;;;;;;;;
(if (< chcaodo 0) (setq daonen (cal "dtnd*-1*chcaodo") ltmdtl (cal "cvnd - (bmata_b+2*blea_b+bmata_d+2*blea_d+bmatb_c+2*bleb_c+bmatd_c+2*bled_c)")
daotaluy (cal "ltmdtl*0.5*chcaodo^2") sumdaonen (cal "daonen + daotaluy + Svhe*(Hvhe+Hdvh) + Vbv + dadambv") dkhdg khdg
tnen1 "&#167;&#181;o n&#210;n &#174;&#173;&#234;ng &#174;&#202;t c&#202;p 3" tkl1 (strcat (rtos sumdaonen) "m3") tnen2 "&#167;&#181;o khu&#171;n m&#198;t &#174;&#173;&#234;ng &#174;&#202;t c&#202;p 3" tkl2 (strcat (rtos dkhdg) "m3")
tnen3 "Lu khu&#171;n m&#198;t &#174;&#173;&#234;ng K=0.98" tkl3 (strcat (rtos dtmd) "m2") tnen4 "&#167;&#181;o n&#210;n nh&#181; & g&#232;c c&#169;y" tkl4 "t&#221;nh ri&#170;ng"
);;;;het setq;;;;;;;;;;;;;;;;;;;
);;;;het if;;;;;;;;;;;;;;;;;;;;;;;
(if (> chcaodo 0) (setq kvhc (getstring "\nVet huu co hoac vet bun (CBun/CH.co/K): ") ))
(if (and (> chcaodo 0) (or (= kvhc "cb") (= kvhc "ch")))
(setq dapnen (cal "dtnd*chcaodo") ltmdtl (cal "cvnd - (bmata_b+2*blea_b+bmata_d+2*blea_d+bmatb_c+2*bleb_c+bmatd_c+2*bled_c)")
daptaluy (cal "ltmdtl*1.5*0.5*chcaodo^2") sumdapnen (cal "dapnen + daptaluy - Svhe*(Hvhe+Hdvh) - Vbv - dadambv-khdg")
vet (getreal "\nNhap chieu day vet huu co hoac vet bun: ") klvet (cal "vet * (dtnd + 0.5*ltmdtl)") tkl1 (strcat (rtos klvet) "m3")
tkl2 (strcat (rtos klvet) "m3") tnen1 "&#167;&#181;o v&#208;t &#174;&#202;t kh&#171;ng ph&#239; h&#238;p" tnen2 "&#167;&#190;p b&#239; &#174;&#181;o v&#208;t &#174;&#202;t c&#202;p 3"
tnen3 "&#167;&#190;p &#174;&#202;t n&#210;n &#174;&#173;&#234;ng k=0.95" tkl3 (strcat (rtos sumdapnen) "m3") tnen4 "&#167;&#181;o n&#210;n nh&#181; & g&#232;c c&#169;y" tkl4 "t&#221;nh ri&#170;ng"
);;;;het setq;;;;;;;;;;;;;;;;;;;
);;;;het if;;;;;;;;;;;;;;;;;;;;;;;
(if (and (> chcaodo 0) (= kvhc "k"))
(setq dapnen (cal "dtnd*chcaodo") ltmdtl (cal "cvnd - (bmata_b+2*blea_b+bmata_d+2*blea_d+bmatb_c+2*bleb_c+bmatd_c+2*bled_c)")
daptaluy (cal "ltmdtl*1.5*0.5*chcaodo^2") sumdapnen (cal "dapnen + daptaluy - Svhe*(Hvhe+Hdvh) - Vbv - dadambv-khdg")
tnen1 "&#167;&#190;p &#174;&#202;t n&#210;n &#174;&#173;&#234;ng k=0.95" tkl1 (strcat (rtos sumdapnen) "m3") tnen2 "lu nguy&#170;n th&#230;"
tkl2 (strcat (rtos dtnd) "m2") tnen3 "" tkl3 "" tnen4 "" tkl4 "" tnen4 "" tkl5 ""
);;;;het setq;;;;;;;;;;;;;;;;;;;
);;;;het if;;;;;;;;;;;;;;;;;;;;;;;
(command "zoom" "c" tam 20 "regen" "-layer" "s" "bgkhoilg" "" "text" "j" "mc" dgbgkl 0 (strcat "b&#182;ng t&#230;ng h&#238;p kh&#232;i l&#173;&#238;ng n&#243;t " ten) "scale" "l" "" dgbgkl 1.5
"line" dg1 dg4 "" "line" dg1 dg1xs "" "line" dg2 dg2x "" "line" dg3 dg3x "" "line" dg4 dg4xs "" "line" dg1x dg4x "" "line" dg1xs dg4xs ""
"text" "j" "mc" chu1 0 "stt" "text" "j" "mc" chu2 0 "h&#185;ng m&#244;c c&#171;ng vi&#214;c" "text" "j" "mc" chu3 0 "kh&#232;i l&#173;&#238;ng"
"text" "j" "ml" (polar chu1 (d:rad -90) 1.6) 0 "i." "text" "j" "ml" (polar chu4 (d:rad -90) 1.6) 0 (strcat "%%un&#210;n &#174;&#173;&#234;ng%%u: S = " (rtos dtnd) "m2")
"text" "j" "ml" (polar chu1 (d:rad -90) 2.4) 0 "1." "text" "j" "ml" (polar chu4 (d:rad -90) 2.4) 0 tnen1 "text" "j" "mc" (polar chu3 (d:rad -90) 2.4) 0 tkl1
"text" "j" "ml" (polar chu1 (d:rad -90) 3.2) 0 "2." "text" "j" "ml" (polar chu4 (d:rad -90) 3.2) 0 tnen2 "text" "j" "mc" (polar chu3 (d:rad -90) 3.2) 0 tkl2
"text" "j" "ml" (polar chu1 (d:rad -90) 4.0) 0 "3." "text" "j" "ml" (polar chu4 (d:rad -90) 4.0) 0 tnen3 "text" "j" "mc" (polar chu3 (d:rad -90) 4) 0 tkl3
"text" "j" "ml" (polar chu1 (d:rad -90) 4.8) 0 "4." "text" "j" "ml" (polar chu4 (d:rad -90) 4.8) 0 tnen4 "text" "j" "mc" (polar chu3 (d:rad -90) 4.8) 0 tkl4
"text" "j" "ml" (polar chu1 (d:rad -90) 5.6) 0 "5." "text" "j" "ml" (polar chu4 (d:rad -90) 5.6) 0 tnen5 "text" "j" "mc" (polar chu3 (d:rad -90) 5.6) 0 tkl5
"text" "j" "ml" (polar chu1 (d:rad -90) 6.4) 0 "ii." "text" "j" "ml" (polar chu4 (d:rad -90) 6.4) 0 (strcat "%%um&#198;t &#174;&#173;&#234;ng%%u:" "S = " (rtos dtmd) "m2")
"text" "j" "ml" (polar chu1 (d:rad -90) 7.2) 0 "1." "text" "j" "ml" (polar chu4 (d:rad -90) 7.2) 0 tlop1 "text" "j" "mc" (polar chu3 (d:rad -90) 7.2) 0 (strcat (rtos dtmd) "m2")
"text" "j" "ml" (polar chu1 (d:rad -90) 8.0) 0 "2." "text" "j" "ml" (polar chu4 (d:rad -90) 8) 0 tlop2 "text" "j" "mc" (polar chu3 (d:rad -90) 8) 0 (strcat (rtos dtmd) "m2")
);;;;;;het command
(if (= keykc "C")
(command "text" "j" "ml" (polar chu1 (d:rad -90) 8.8) 0 "3." "text" "j" "ml" (polar chu4 (d:rad -90) 8.8) 0 tlop3 "text" "j" "mc" (polar chu3 (d:rad -90) 8.8) 0 kllop3)
);;;;;het if;;;;;;;;
(if (= keykc "M")
(command "text" "j" "ml" (polar chu1 (d:rad -90) 8.8) 0 "3." "text" "j" "ml" (polar chu4 (d:rad -90) 8.8) 0 tlop3 "text" "j" "mc" (polar chu3 (d:rad -90) 8.8) 0 (strcat (rtos dtmd) "m2"))
);;;;;het if
(if (= keykc "C")
(command "text" "j" "ml" (polar chu1 (d:rad -90) 9.6) 0 "4." "text" "j" "ml" (polar chu4 (d:rad -90) 9.6) 0 tlop4 "text" "j" "mc" (polar chu3 (d:rad -90) 9.6) 0 tklth)
);;;;;het if
(if (and (= keykc "M") (= kca "a1"))
(command "text" "j" "ml" (polar chu1 (d:rad -90) 9.6) 0 "4." "text" "j" "ml" (polar chu4 (d:rad -90) 9.6) 0 tlop4 "text" "j" "mc" (polar chu3 (d:rad -90) 9.6) 0 (strcat (rtos dtmd) "m2"))
);;;;het if
(if (and (= keykc "M") (= kca "a2"))
(command "text" "j" "ml" (polar chu1 (d:rad -90) 9.6) 0 "4." "text" "j" "ml" (polar chu4 (d:rad -90) 9.6) 0 tlop4 "text" "j" "mc" (polar chu3 (d:rad -90) 9.6) 0 kllop4)
);;;;het if
(if (= keykc "C")
(command "text" "j" "ml" (polar chu1 (d:rad -90) 10.4) 0 "5." "text" "j" "ml" (polar chu4 (d:rad -90) 10.4) 0 tlop5 "text" "j" "mc" (polar chu3 (d:rad -90) 10.4) 0 tklmatit)
);;;;;het if
(if (and (= keykc "M") (= kca "a1"))
(command "text" "j" "ml" (polar chu1 (d:rad -90) 10.4) 0 "5." "text" "j" "ml" (polar chu4 (d:rad -90) 10.4) 0 tlop5 "text" "j" "mc" (polar chu3 (d:rad -90) 10.4) 0 kllop5)
);;;;het if
(if (and (= keykc "M") (= kca "a2"))
(command "text" "j" "ml" (polar chu1 (d:rad -90) 10.4) 0 "5." "text" "j" "ml" (polar chu4 (d:rad -90) 10.4) 0 tlop5 "text" "j" "mc" (polar chu3 (d:rad -90) 10.4) 0 kllop5)
);;;;het if
(command
"text" "j" "ml" (polar chu1 (d:rad -90) 11.2) 0 "iii." "text" "j" "ml" (polar chu4 (d:rad -90) 11.2) 0 "%%uv&#216;a h&#204;:"
"text" "j" "ml" (polar chu1 (d:rad -90) 12.0) 0 "1." "text" "j" "ml" (polar chu4 (d:rad -90) 12.0) 0 "chi&#210;u d&#181;i b&#227; v&#216;a" "text" "j" "mc" (polar chu3 (d:rad -90) 12) 0 (strcat (rtos Lbv) "m")
"text" "j" "ml" (polar chu1 (d:rad -90) 12.8) 0 "2." "text" "j" "ml" (polar chu4 (d:rad -90) 12.8) 0 "B&#170; t&#171;ng b&#227; v&#216;a m200 &#174;&#184; 1x2" "text" "j" "mc" (polar chu3 (d:rad -90) 12.8) 0 (strcat (rtos Vbv) "m3")
"text" "j" "ml" (polar chu1 (d:rad -90) 13.6) 0 "3." "text" "j" "ml" (polar chu4 (d:rad -90) 13.6) 0 (strcat "&#167;&#214;m m&#227;ng &#174;&#184; d&#168;m b&#227; v&#216;a d&#181;y " (rtos (cal "Hda*100")) "cm") "text" "j" "mc" (polar chu3 (d:rad -90) 13.6) 0 (strcat (rtos dadambv) "m3")
"text" "j" "ml" (polar chu1 (d:rad -90) 14.4) 0 "4." "text" "j" "ml" (polar chu4 (d:rad -90) 14.4) 0 "V&#184;n khu&#171;n b&#227; v&#216;a" "text" "j" "mc" (polar chu3 (d:rad -90) 14.4) 0 (strcat (rtos Svkbv) "m2")
"text" "j" "ml" (polar chu1 (d:rad -90) 15.2) 0 "5." "text" "j" "ml" (polar chu4 (d:rad -90) 15.2) 0 Slatvh "text" "j" "mc" (polar chu3 (d:rad -90) 15.2) 0 (strcat (rtos Svhe) "m2")
"text" "j" "ml" (polar chu1 (d:rad -90) 16.0) 0 "6." "text" "j" "ml" (polar chu4 (d:rad -90) 16) 0 Sdvh "text" "j" "mc" (polar chu3 (d:rad -90) 16) 0 (strcat (rtos Svhe) "m2")

;;;;;;;;chen khung ten;;;;;;;;;;;;;;;;;
(progn (if (and (> (cal "2*(tieptuyen+blea_d+10)") 50.38) (< (cal "2*(tieptuyen+blea_d+10)") 62.98))
(setq tleso 1.25 kten "kten1-250") (setq tleso 1.0 kten "kten1-200")
);;;;;;;;het if;;;;;;;;;;;;;;;;;;;;
(if (and (> (cal "2*(tieptuyen+blea_d+10)") 62.98) (< (cal "2*(tieptuyen+blea_d+10)") 100.76))
(setq tleso 2.0 kten "kten1-400")
(if (> (cal "2*(tieptuyen+blea_d+10)") 100.76) (setq tleso 2.5 kten "kten1-500")
);;;het if;;;;;;;;;;;;;;;;;;;
);;;;;;;;het if;;;;;;;;;;;;;;;;;;;;
);;;;het progn;;;;;;;;;;;;;;;;;;;;;;;;;;
"-insert" kten (getpoint "\nChon diem chen khung ten ban ve: ") "" "" ""
"explode" "last" ""
);;;;;;;;het lenh
(setq lua2 (ssget "x" '( (-4 . "<OR") (8 . "bgkhoilg")
(8 . "bgtoado")
(8 . "bggoc")
(-4 . "OR>") )
)
);;;;;het setq
(command "_layiso" lua2 "")
(setq chonkl (ssget "x" '( (-4 . "<OR")
(8 . "bgkhoilg")
(-4 . "OR>") )
)
)
(command ".-group" "e" "bgkhlg" "" ".-group" "c" "bgkhlg" "bg2" chonkl ""
"scale" chonkl "" gtl tleso ""
);;;;;het com
(setq chon (ssget "x" '( (-4 . "<OR")
(8 . "bggoc")
(-4 . "OR>") )
)
)
(command ".-group" "E" "bytc" "")
(command ".-group" "c" "bytc" "bg1" chon "")
(command
"scale" chon "" dg1 tleso ""
);;;;;het com
(setq chontd (ssget "x" '( (-4 . "<OR")
(8 . "bgtoado")
(-4 . "OR>") )
)
)
(command ".-group" "E" "btd" "")
(command ".-group" "c" "btd" "bg3" chontd "")
(command
"scale" chontd "" gtd tleso ""
);;;;;het com

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(command "layuniso")
(command "zoom" "c" tam 30)
(setvar "CMDECHO" 1)

);;;;;;;;;;;het ham chu


  • 0

#2 Detailing

Detailing

    biết lệnh imageclip

  • Members
  • PipPipPipPipPipPipPip
  • 667 Bài viết
Điểm đánh giá: 278 (khá)

Đã gửi 16 September 2011 - 01:32 PM

Có 1 người bạn gửi cho mình 1 file lisp nhưng khi mở file lisp thì thấy lạ ở chỗ thiết câu lệnh là "defun d:xxx",load lisp lên thì không chạy được,sau đó mình đổi lại thành defun c nhưng load lisp lên cũng không chạy được.Nhờ các bác test giùm em

lệnh là NUT test thử thì bị lỗi : ; error: bad argument type: stringp nil
Bạn tìm đế hàm chính (defun C:nut() rồi coi thử nó bị lỗi gì :P
  • 0

Ideas don't matter, execution does!

1908412_308002392716743_8165279281236341


#3 cd2k44

cd2k44

    Edu level: li5

  • Members
  • PipPipPipPipPipPipPip
  • 648 Bài viết
Điểm đánh giá: 121 (tàm tạm)

Đã gửi 16 September 2011 - 03:05 PM

Em dùng trình soạn thảo vlide tìm lỗi thì thấy báo lỗi tại đoạn (command layer....) phía sau câu lệnh nut nhưng không biết là lỗi gì.Bác có thể chỉ cho em lỗi được không ah.Cảm ơn các bác
  • 0

#4 npham

npham

    biết lệnh rotate

  • Members
  • PipPipPip
  • 136 Bài viết
Điểm đánh giá: 75 (tàm tạm)

Đã gửi 16 September 2011 - 07:39 PM

Biến ghb ở ngay đầu hàm c:nut chưa được gán giá trị. Không biết nó là cái gì. Và rất nhiều biến nữa chưa có giá trị.

Nhìn cái lisp của bác post hãi quá,
  • 0