Lisp lệnh BANG trong chủ đề “Lấy dữ liệu từ file autocard vào file excel”
discount cymbalta coupons Jodie Callahan, Jessica Hunt and Dezerah Silsby were indicted on five counts including forced labor, acquiring a controlled substance by deception and theft of government benefits related to allegations they forced the woman to use her public assistance money to buy groceries and cigarettes for them.
discount prozac no prescription Gross production, which includes production from wellsKodiak does not operate but has a stake in, has risen to "justshy" of 50,000 barrels of oil equivalent per day (boe/d), CEOLynn Peterson said on Wednesday.
isotretinoin pregnancy category Sergio George has been the driving force behind many of the biggest names in Latin music, so itâs no surprise the Grammy Award-winning producer would bring some of these giants together for a live album.
discount prozac no prescription Gross production, which includes production from wellsKodiak does not operate but has a stake in, has risen to "justshy" of 50,000 barrels of oil equivalent per day (boe/d), CEOLynn Peterson said on Wednesday.
isotretinoin pregnancy category Sergio George has been the driving force behind many of the biggest names in Latin music, so itâs no surprise the Grammy Award-winning producer would bring some of these giants together for a live album.
Tệp .lsp gốc không còn trên máy chủ. Hãy chép mã nguồn bên dưới (lấy từ bài viết gốc) vào một tệp văn bản, lưu với đuôi .lsp.
Cách dùng
- Chép mã nguồn, lưu thành tệp 274158_bang.lsp.
- Trong AutoCAD gõ lệnh APPLOAD, chọn tệp vừa tải rồi bấm Load. Cũng có thể kéo thả tệp .lsp vào cửa sổ bản vẽ.
- Gõ lệnh BANG để chạy lisp.
Mã nguồn 274158_bang.lsp (trích từ bài viết gốc)
: Ha Van Khanh 3/2003
;
; * Chuong trinh duoc lap bang ngon ngu AUTOLISP.
; ------------------------------------------------------------------------------
(vmon)
(defun C:bang (/ 1x 1y a1 2x 2y a2 3x 3y a3 b p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16x p16y p16 p17x p17y p17)
(setvar "cmdecho" 0)
(initget 7)
(setq osm (getvar "osmode" ))
(setvar "osmode" 0)
(command "-Style" "hoatbif" "hoatbif " "2.5" "" "" "" "" "")
(command "-Layer" "n" "Text" "c" "4" "Text" "")
(setq p1 (getpoint "\nChän diÓm dÆt b¶ng thèng kª :"))
(setq S (getint "\nSè ®iÓm cÇn tƯnh to¹ ®é :"))
(setq p2 (polar p1 (/ (* Pi 3) 2) (+ 16 (* 8 S))))
(setq p3 (polar p2 0 91))
(setq p4 (polar p1 0 91))
(setq p5 (polar p1 0 21))
(setq p6 (polar p2 0 21))
(setq p7 (polar p5 0 35))
(setq p8 (polar p6 0 35))
(setq p9 (polar p5 (/ (* Pi 3) 2) 8))
(setq p10 (polar p4 (/ (* Pi 3) 2) 8))
(setq p12 (polar p9 0 35))
(setq p11 (polar p9 0 -10.5))
(setq p13 (polar p1 (/ (* Pi 3) 2) 16))
(setq p14 (polar p4 (/ (* Pi 3) 2) 16))
(setq p15 (polar p7 (/ (* pi 3 ) 2) 4))
(setq p16x (/ (+ (car p5) (car p7)) 2))
(setq p16y (/ (+ (cadr p9) (cadr p13)) 2))
(setq p17x (/ (+ (car p4) (car p7)) 2))
(setq p17y (/ (+ (cadr p9) (cadr p13)) 2))
(setq p16 (list p16x p16y))
(setq p17 (list p17x p17y))
(command "Plinewid" "0.5")
(command "Pline" p1 p2 p3 p4 p1 "")
(command "Line" p5 p6 "")
(command "Line" p12 p8 "")
(command "Line" p9 p10 "")
(command "Line" p13 p14 "")
(command "Array" "l" "" "Rec" S "1" "-8")
(command "text" "j" "mc" p11 "0" "Tªn nót" )
(command "text" "j" "mc" p15 "0" "To¹ ®é" )
(command "text" "j" "mc" p16 "0" "X" )
(command "text" "j" "mc" p17 "0" "Y" )
(setvar "osmode" 1)
;-------------------------------------------------
; PhÇn sö lư ch÷
(setq b 0)
(while (< b s )
(setq b (+ b 1))
(setq td (getstring "\NhËp tªn ®iÓm lÊy to¹ dé : "))
(setq tp (getpoint "\Chän ®iÓm : "))
(setq tx (rtos (car tp) 2 4 ))
(setq ty (rtos (cadr tp) 2 4 ))
(setq 1x (/ (+ (car p1) (car p5)) 2))
(setq 1y (- (- (cadr p11) 4) (* 8 b)))
(setq a1 (list 1x 1y))
(setq 2x (/ (+ (car p5) (car p7)) 2))
(setq 2y (- (cadr p16) (* 8 b)))
(setq a2 (list 2x 2y))
(setq 3x (/ (+(car p7) (car p4)) 2))
(setq 3y (- (cadr p17) (* 8 b)))
(setq a3 (list 3x 3y))
(command "text" "j" "mc" a1 "0" td "" )
(command "text" "j" "mc" a3 "0" tx "" )
(command "text" "j" "mc" a2 "0" ty "" )
)
)Thảo luận gốc
Lisp được chia sẻ trong chủ đề Lấy dữ liệu từ file autocard vào file excel. Xem đúng bài viết #274158 để đọc hướng dẫn và trao đổi thêm.