Jump to content

Lisp lệnh ORP RT2 GIA TL trong chủ đề “[LI]BT chương 4.3 - Xử lý list”

libido max for her Anthony Bosch of Miami, accused of supplying performance-enhancing drugs through his Biogenesis anti-aging clinic, is in town to meet with MLB officials in preparation for testimony in Alex Rodriguez’s arbitration hearing on Sept. 30.
vigaplus uk In a proper film-making nation, this would surely be hailed the most exciting generation of young female acting talent since the 1970s-born class of Kate Winslet, Rachel Weisz, Lena Headey and Thandie Newton. These are not your average bland starlets – they"re individual and versatile, with a knack for accents. The only thing holding them back is the scarcity of British films with female leads, so little wonder there"s a young female British invasion of Los Angeles already underway. Let"s just hope they don"t end up in boring girlfriend roles. They deserve better.
herbalife prelox blue antiossidante “Given a nearly equal mix of positives and negatives it is difficult to form a strong view on the likely outcome, but on balance we are somewhat more skeptical that FedEx is the name in focus for Pershing Square,” the analyst said in a research note. “Our sense is that the commentary from the letter (free cash generative, customer switching costs, high barriers) does not imply a narrow characterization and that FedEx could fit a loose definition of the description.”
libidus price President Obama has now committed to supporting the rebels in Syria. The White House"s reversal on that front is the right decision. Mostly it is right because it is an actual decision – something that has been lacking in American policy on Syria for the last year.
uso proextender Earlier this month, Amazon announced its MatchBook scheme, which will offer digital copies of 10,000 titles when they are bought in print. Some will be free, while others will cost up to $2.99 (£1.92).
femigra funziona Prime Minister David Cameron, bowing to pressure from the Eurosceptic right of his Conservative Party, has proposed a referendum on whether Britain should leave the European Union. Both the Liberal Democrat junior coalition partner and Labour opposition party have spoken out against the referendum, which would not be held before the next general election is due in 2015.
xytomax does it work The new Game Controller framework, added in iOS 7 and OS X v10.9, makes it easy to find controllers connected to a Mac or iOS device. Once discovered, your game reads control inputs as part of its normal gameplay. There are three kinds of controllers available:
libimax vs libigrow Michael Spurr, chief executive of the National Offender Management Service, said it was pleasing to see good work was taking place in resettlement and offender management and that the needs of prisoners were largely being met. He added: "Decisive action has already been taken to build on this work and address concerns raised in the report, particularly in the areas of training and purposeful activity. The prison and its staff will receive the support necessary to help raise performance and deliver a safe and constructive environment for the prisoners it holds."
buy prosolution online The challenge Apple faces stems in part from its iPhone strategy. Aside from the iPhone, Apple has historically created new product models at a variety of prices to appeal to different market segments.

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

  1. Chép mã nguồn, lưu thành tệp 249691_orp_rt2_gia_tl.lsp.
  2. 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ẽ.
  3. Gõ lệnh ORP RT2 GIA TL để chạy lisp.

Mã nguồn 249691_orp_rt2_gia_tl.lsp (trích từ bài viết gốc)

;4.3.1 Viet lenh viet ra man hinh toa do 1 diem nguoi dung chon theo dang X=, Y=, Z=
(defun C:orp(/ os echo p);ordinate point
  (setq os (getvar 'osmode)
echo (getvar 'cmdecho))
  (setvar 'osmode 0)
  (setvar  'cmdecho 0)
  (setq p (getpoint "\nSpecify a point:"))
  (alert (strcat "X= " (rtos (car p) 2 2) "; Y= " (rtos (cadr p) 2 2) "; Z= " (rtos (last p) 2 2)))
  (setvar 'osmode os)
  (setvar 'cmdecho echo)
  (princ)
  )
;4.3.2 Viet lenh ve hinh chu nhat doi nhu sau, so luong bien nhap vao do nguoi viet quyet dinh
(defun C:rt2(/ old c1 c2 d);rectang2
(setq old (mapcar 'getvar '("cmdecho" "osmode")))
(mapcar 'setvar '("cmdecho" "osmode") '(0 0))
(setq c1 (getpoint "\nSpecify first corner point: ")
      c2 (getcorner c1 "\nSpecify other corner point:")
      d  (getdist "\nSpecify offset distance:")
      )
(command ".rectang" c1 c2) 
(command ".offset" d (entlast) (list (* (+ (car c1) (car c2)) 0.5) (* (+ (cadr c1) (cadr c2)) 0.5)) "")
(mapcar 'setvar '("cmdecho" "osmode") old)
(princ)
)
;4.3.3 Viet ham loai bo mot phan tu ra khoi list
;VD: (remove 3 (list 1 2 3 4 5 6 7 8 9) =(1 2 4 5 6 7 8 9)
(defun remove(part lst / lst1 lst2)
  (setq lst1 (reverse(cdr(member part(reverse lst))))
lst2 (cdr(member part lst)))
  (princ "\n the remaining list :")
  (append lst1 lst2)
  )
;4.3.4 Viet lenh tra gia tien cua 1 trong 3 mat hang do nguoi dung chon.
;biet loai 1 gia 100000, loai 2 gia 200000 va loai 3 gia 300000
(defun C:gia(/ loai)  
  (setq loai (getint "\nBan muon xem gia hang loai <1, 2, 3>:"))
  (if (= loai 1)
    (alert "\Gia hang Loai 1 la: 100000")
    (if (= loai 2) (alert "\Gia hang loai 2 la: 200000")
      (if (= loai 3) (alert "Gia hang loai 3 la : 300000") (alert "Khong tim thay gia loai hang nay"))))
  (princ)   
  )
;4.3.5 Viet lenh tra tu dien. Du lieu la 1 list do nguoi viet nhap. Nguoi dung tra tu tieng anh
;--> tra ve tieng viet khong dau tuong ung trong list. khong co thi chuong trinh im lang
(defun c:TL( / str);translated
(setq str (xstrcase (getstring "\n Nhap mot tu Tieng Anh <one/two/three/four/five/six/seven/eight/nine/ten>: ")))
(alert (cdr (assoc str (list (cons "ONE" "1") (cons "TWO" "2") (cons "THREE" "3") (cons  "FOUR" "4") (cons  "FIVE" "5")
    (cons "SIX" "6") (cons "SEVEN" "7") (cons "EIGHT" "8") (cons  "NINE" "9") (cons  "TEN" "10")))))
(princ)
)

Thảo luận gốc

Lisp được chia sẻ trong chủ đề [LI]BT chương 4.3 - Xử lý list. Xem đúng bài viết #249691 để đọc hướng dẫn và trao đổi thêm.

Về Thư viện AutoLisp (trang 141)