Admin Thượng úy
Tổng số bài gửi : 103 Điểm : 291 Reputation : 34 Join date : 15/01/2011
| Tiêu đề: [Lisp]Vẽ taluy hướng tâm Thu Oct 20, 2011 9:35 am | |
| - Code:
-
[/color][color=blue][font=Courier New](defun c:tlt(/ eLine curve pt i j len dsttmp) (vl-load-com) (or #dist (setq #dist 10)) ; 10 = Khoang cach mac dinh (setq #dist (cond ((getdist (strcat "\n D <" (vl-princ-to-string #dist) " > :")))(#dist))) (defun eLine (p1 P isFull / p2 col) (if isFull (setq p2 P col 1) ;1 = Mau cua Line full (setq p2 (polar p1 (angle p1 P) (/ (distance p1 P) 2)) col 8) ; 8 = Mau cua Line nua ) (entmake (list (cons 0 "LINE")(cons 10 p1) (cons 11 p2)(cons 62 col) (cons 8 "0") ;0 = Layer cua Duong Taluy ) ) ) ;;Doan duoi nay khong can de y (while (and (setq curve (car(entsel "\nPath curve :"))) (wcmatch (cdadr (entget curve)) "*LINE,ARC") (setq pt (getpoint "\n P :")) (setq i -2 j -1 len (vlax-curve-getDistAtParam curve (vlax-curve-getEndParam curve))) ) (progn (while (< (setq dsttmp (* (setq i (+ i 2)) #dist)) len) (eLine (vlax-curve-getPointAtDist curve dsttmp) pt T)) (while (< (setq dsttmp (* (setq j (+ j 2)) #dist)) len) (eLine (vlax-curve-getPointAtDist curve dsttmp) pt nil)) ) ))[/font]
Tác giả : Ketxu | |
|
tvgtyb08 Thiếu úy
Tổng số bài gửi : 5 Điểm : 7 Reputation : 0 Join date : 18/10/2011
| Tiêu đề: Re: [Lisp]Vẽ taluy hướng tâm Fri Oct 21, 2011 5:08 pm | |
| | |
|