Đến nội dung


Hình ảnh
- - - - -

[Nhờ chỉnh sửa]Vẽ mặt cắt móng


  • Please log in to reply
2 replies to this topic

#1 quan08

quan08

    biết vẽ pline

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

Đã gửi 25 September 2011 - 09:23 PM

Mình sưu tầm được lisp vẽ mặt cắt móng,vì phát hiện 1 chỗ vẽ không đúng,vừa mày mò vừa lên diễn đàn nhờ các bác giải thích giúp nhưng làm mãi không được.Nay đưa lên nhờ các bác sửa giúp những cái e cần:
http://www.cadviet.c...drawing1_91.dwg
Và đây là đoạn lisp nhờ các bác sửa:
 
;;Ham ve mc cac thanh thep
(defun mcthep (pd pc d n)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(setq kc (/ (- (distance pd pc) d) (- n 1)))
(command ".line" pd pc "")

(setq a (angle pd pc)
pd (list (+ (car pd) (/ d 2)) (+ (cadr pd) (/ d 2)))
)

(repeat n
(command ".donut" 0 d pd c^)
(setq pd(polar pd a kc))
)
;;(command ".donut" 0 d (polar pc (+ a (* pi 0.75)) d) c^)
(setvar "osmode" old)
)
;;Ham ve thep dai va thep chiu luc cua dam mong
(defun vdai (p1 a b n1 n2 d)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(command ".rectangle" p1 (list (+ (car p1) a) (+ (cadr p1) B)))
(setq kc (/ (- a d) (- n1 1))
p1 (list (+ (car p1) (/ d 2)) (+ (cadr p1) (/ d 2)))
)
;(princ n1)
(setq p p1)
(repeat n1
(command ".donut" 0 d p c^)
(setq p (polar p 0 kc))
);end of repeat1
(setq p (polar p1 (/ pi 2) (- b d)))
(repeat n1
(command ".donut" 0 d p c^)
(setq p (polar p 0 kc))
);end of repeat2
(setq kc (/ (- b d) (- n2 1)))
(setq p (polar p1 (/ pi 2) kc))
(repeat (- n2 1)
(command ".donut" 0 d p c^)
(setq p (polar p (/ pi 2) kc))
);end of repeat3
(setq p (polar p1 0 (- a d)))
(setq p (polar p (/ pi 2) kc))
(repeat ( - n2 1)
(command ".donut" 0 d p c^)
(setq p (polar p (/ pi 2) kc))
);end of repeat4

(setvar "osmode" old)
)
;; Chuong trinh chinhs vex mc mongs
(defun c:mcm1 ()
(initget 1 "MC MB")
(setq res (getkword "\n<M.BANG/M.COT><MB/MC>:"))
(setq p1 (getpoint "\nDiem chen:")
l1 (getreal "\nBe rong mong:")
l2 (getreal "\nBe rong co mong:")
l3 (/ (- l1 l2) 2)
h1 (getreal "\nChieu cao ben mong:")
h2 (getreal "\nChieu cao phan nghieng:")
h3 (getreal "\nChieu cao co mong:")
bv (getreal "\nBe day lop bao ve:")
d (getreal "\nDuong kinh thep:")
n (getint "\nS.luong thep day mong:")
)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(setq p (polar p1 pi 100))
(setq p (polar p (/ (- 0 pi) 2) 100))
(command ".rectangle" p (list (+ (car p) 200 l1) (+ (cadr p) 100)))
(command ".pline" p1 "W" 0 0 (setq p (polar p1 (/ pi 2) h1)) (setq p (list (+ (car p) l3) (+ (cadr p) h2))) (setq p (polar p (/ pi 2) h3)) ""
)
(command ".mirror" "l" "" (setq p (polar p1 0 (/ l1 2))) (setq p (polar p (/ pi 2) (/ l1 2))) "")
(setq pd (list (+ (car p1) bv) (+ (cadr p1) bv))
pc (polar pd 0 (- l1 (* 2 bv)))
)
(mcthep pd pc d n)

(IF (= res "MB")
(progn
(setq p (list (+ (car p1) l3 bv) (+ (cadr p1) d bv))
a (- l2 (* 2 bv))
b (- (+ h1 h2 h3) (* 2 bv) d)
n1 (getint "\nS.luong thep ngang dam mong:")
n2 (getint "\nS.luong thep doc dam mong:")
)
(vdai p a b n1 n2 d)
);end of progn1
(progn
(setq p (list (+ (car p1) l3 bv (- 0 (* 10 d))) (+ (cadr p1) (* 2 d) bv))); end of setq
(command ".pline" p "W" 0 0 (setq p (polar p 0 (* 10 d)))
(setq p (polar p (/ pi 2) (+ h1 h2 h3 (* 20 d) (- 0 (* 2 d) bv))))
(setq p (polar p (/ (- 0 pi) 4) (* 2 d))) ""
); end of co
(command ".mirror" "l" "" (setq p (polar p1 0 (/ l1 2))) (setq p (polar p (/ pi 2) (/ l1 2))) "" ); end of co
);end of progn2

); end of if
(setvar "osmode" old)
)
Cảm ơn các bác đã dành thời gian quan tâm.
  • 0

#2 quan08

quan08

    biết vẽ pline

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

Đã gửi 26 September 2011 - 05:17 PM

Mình sưu tầm được lisp vẽ mặt cắt móng,vì phát hiện 1 chỗ vẽ không đúng,vừa mày mò vừa lên diễn đàn nhờ các bác giải thích giúp nhưng làm mãi không được.Nay đưa lên nhờ các bác sửa giúp những cái e cần:
http://www.cadviet.c...drawing1_91.dwg
Và đây là đoạn lisp nhờ các bác sửa:


;;Ham ve mc cac thanh thep
(defun mcthep (pd pc d n)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(setq kc (/ (- (distance pd pc) d) (- n 1)))
(command ".line" pd pc "")

(setq a (angle pd pc)
pd (list (+ (car pd) (/ d 2)) (+ (cadr pd) (/ d 2)))
)

(repeat n
(command ".donut" 0 d pd c^)
(setq pd(polar pd a kc))
)
;;(command ".donut" 0 d (polar pc (+ a (* pi 0.75)) d) c^)
(setvar "osmode" old)
)
;;Ham ve thep dai va thep chiu luc cua dam mong
(defun vdai (p1 a b n1 n2 d)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(command ".rectangle" p1 (list (+ (car p1) a) (+ (cadr p1) B)))
(setq kc (/ (- a d) (- n1 1))
p1 (list (+ (car p1) (/ d 2)) (+ (cadr p1) (/ d 2)))
)
;(princ n1)
(setq p p1)
(repeat n1
(command ".donut" 0 d p c^)
(setq p (polar p 0 kc))
);end of repeat1
(setq p (polar p1 (/ pi 2) (- b d)))
(repeat n1
(command ".donut" 0 d p c^)
(setq p (polar p 0 kc))
);end of repeat2
(setq kc (/ (- b d) (- n2 1)))
(setq p (polar p1 (/ pi 2) kc))
(repeat (- n2 1)
(command ".donut" 0 d p c^)
(setq p (polar p (/ pi 2) kc))
);end of repeat3
(setq p (polar p1 0 (- a d)))
(setq p (polar p (/ pi 2) kc))
(repeat ( - n2 1)
(command ".donut" 0 d p c^)
(setq p (polar p (/ pi 2) kc))
);end of repeat4

(setvar "osmode" old)
)
;; Chuong trinh chinhs vex mc mongs
(defun c:mcm1 ()
(initget 1 "MC MB")
(setq res (getkword "\n<M.BANG/M.COT><MB/MC>:"))
(setq p1 (getpoint "\nDiem chen:")
l1 (getreal "\nBe rong mong:")
l2 (getreal "\nBe rong co mong:")
l3 (/ (- l1 l2) 2)
h1 (getreal "\nChieu cao ben mong:")
h2 (getreal "\nChieu cao phan nghieng:")
h3 (getreal "\nChieu cao co mong:")
bv (getreal "\nBe day lop bao ve:")
d (getreal "\nDuong kinh thep:")
n (getint "\nS.luong thep day mong:")
)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(setq p (polar p1 pi 100))
(setq p (polar p (/ (- 0 pi) 2) 100))
(command ".rectangle" p (list (+ (car p) 200 l1) (+ (cadr p) 100)))
(command ".pline" p1 "W" 0 0 (setq p (polar p1 (/ pi 2) h1)) (setq p (list (+ (car p) l3) (+ (cadr p) h2))) (setq p (polar p (/ pi 2) h3)) ""
)
(command ".mirror" "l" "" (setq p (polar p1 0 (/ l1 2))) (setq p (polar p (/ pi 2) (/ l1 2))) "")
(setq pd (list (+ (car p1) bv) (+ (cadr p1) bv))
pc (polar pd 0 (- l1 (* 2 bv)))
)
(mcthep pd pc d n)

(IF (= res "MB")
(progn
(setq p (list (+ (car p1) l3 bv) (+ (cadr p1) d bv))
a (- l2 (* 2 bv))
b (- (+ h1 h2 h3) (* 2 bv) d)
n1 (getint "\nS.luong thep ngang dam mong:")
n2 (getint "\nS.luong thep doc dam mong:")
)
(vdai p a b n1 n2 d)
);end of progn1
(progn
(setq p (list (+ (car p1) l3 bv (- 0 (* 10 d))) (+ (cadr p1) (* 2 d) bv))); end of setq
(command ".pline" p "W" 0 0 (setq p (polar p 0 (* 10 d)))
(setq p (polar p (/ pi 2) (+ h1 h2 h3 (* 20 d) (- 0 (* 2 d) bv))))
(setq p (polar p (/ (- 0 pi) 4) (* 2 d))) ""
); end of co
(command ".mirror" "l" "" (setq p (polar p1 0 (/ l1 2))) (setq p (polar p (/ pi 2) (/ l1 2))) "" ); end of co
);end of progn2

); end of if
(setvar "osmode" old)
)
Cảm ơn các bác đã dành thời gian quan tâm.

Mong các bác bớt chút thời gian giúp e với.Thanks.
  • 0

#3 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 26 September 2011 - 08:47 PM

Mình sửa tạm theo kiểu chắp vá bạn dùng đỡ, rãnh rỗi làm cái hộp thoại nhập số liệu chứ nhập kiểu này mỏi tay quá.


 


;;Ham ve mc cac thanh thep
(defun mcthep (pd pc d n)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(setq kc (/ (- (distance pd pc) d) (- n 1)))
(command ".line" pd pc "")

(setq a (angle pd pc)
pd (list (+ (car pd) (/ d 2)) (+ (cadr pd) (/ d 2)))
)

(repeat n
(command ".donut" 0 d pd c^)
(setq pd(polar pd a kc))
)
;;(command ".donut" 0 d (polar pc (+ a (* pi 0.75)) d) c^)
(setvar "osmode" old)
)
;;Ham ve thep dai va thep chiu luc cua dam mong
(defun vdai (p1 a b n1 n2 d)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(command ".rectangle" p1 (list (+ (car p1) a) (+ (cadr p1) B)))
(setq kc (/ (- a d) (- n1 1))
p1 (list (+ (car p1) (/ d 2)) (+ (cadr p1) (/ d 2)))
)
;(princ n1)
(setq p p1)
(repeat n1
(command ".donut" 0 d p c^)
(setq p (polar p 0 kc))
);end of repeat1
(setq p (polar p1 (/ pi 2) (- b d)))
(repeat n1
(command ".donut" 0 d p c^)
(setq p (polar p 0 kc))
);end of repeat2
(setq kc (/ (- b d) (- n2 1)))
(setq p (polar p1 (/ pi 2) kc))
(repeat (- n2 1)
(command ".donut" 0 d p c^)
(setq p (polar p (/ pi 2) kc))
);end of repeat3
(setq p (polar p1 0 (- a d)))
(setq p (polar p (/ pi 2) kc))
(repeat ( - n2 1)
(command ".donut" 0 d p c^)
(setq p (polar p (/ pi 2) kc))
);end of repeat4

(setvar "osmode" old)
)
;; Chuong trinh chinhs vex mc mongs
(defun c:mcm1 ()
(initget 1 "MC MB")
(setq res (getkword "\n<M.BANG/M.COT><MB/MC>:"))
(setq p1 (getpoint "\nDiem chen:")
l1 (getreal "\nBe rong mong:")
l2 (getreal "\nBe rong co mong:")
l3 (/ (- l1 l2) 2)
h1 (getreal "\nChieu cao ben mong:")
h2 (getreal "\nChieu cao phan nghieng:")
h3 (getreal "\nChieu cao co mong:")
bv (getreal "\nBe day lop bao ve:")
d (getreal "\nDuong kinh thep:")
n (getint "\nS.luong thep day mong:")
)
(setq old (getvar "osmode"))
(setvar "osmode" 0)
(setq p (polar p1 pi 100))
(setq p (polar p (/ (- 0 pi) 2) 100))
(command ".rectangle" p (list (+ (car p) 200 l1) (+ (cadr p) 100)))
(command ".pline" p1 "W" 0 0 (setq p (polar p1 (/ pi 2) h1)) (setq p (list (+ (car p) l3) (+ (cadr p) h2))) (setq p (polar p (/ pi 2) h3)) ""
)
(command ".mirror" "l" "" (setq p (polar p1 0 (/ l1 2))) (setq p (polar p (/ pi 2) (/ l1 2))) "")

(IF (= res "MB")
(progn
(setq pd (list (+ (car p1) bv) (+ (cadr p1) bv))
pc (polar pd 0 (* (- l1 (* 4 bv) l2) 0.5))
)
(mcthep pd pc d (fix (* n 0.5)))

(command ".line" pc (setq pc (polar pc 0 (+ l2 (* 2 bv)))) "")
(setq pd (polar pd 0 (- l1 (* 2 bv))))

(mcthep pc pd d (fix (* n 0.5)))
(setq p (list (+ (car p1) l3 bv) (+ (cadr p1) d bv))
a (- l2 (* 2 bv))
b (- (+ h1 h2 h3) (* 2 bv) d)
n1 (getint "\nS.luong thep ngang dam mong:")
n2 (getint "\nS.luong thep doc dam mong:")
)
(vdai p a b n1 n2 d)
);end of progn1
(progn
(setq pd (list (+ (car p1) bv) (+ (cadr p1) bv))
pc (polar pd 0 (- l1 (* 2 bv)))
)
(mcthep pd pc d n)
(setq p (list (+ (car p1) l3 bv (- 0 (* 10 d))) (+ (cadr p1) (* 2 d) bv))); end of setq
(command ".pline" p "W" 0 0 (setq p (polar p 0 (* 10 d)))
(setq p (polar p (/ pi 2) (+ h1 h2 h3 (* 20 d) (- 0 (* 2 d) bv))))
(setq p (polar p (/ (- 0 pi) 4) (* 2 d))) ""
); end of co
(command ".mirror" "l" "" (setq p (polar p1 0 (/ l1 2))) (setq p (polar p (/ pi 2) (/ l1 2))) "" ); end of co
);end of progn2

); end of if
(setvar "osmode" old)
)

  • 1