
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
(defun C:test ()
(defun thang ()
(setq A (getpoint "Fist pick 1: "))
(setq B (getpoint "Second pick 2: "))
(command "line" A B "")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun tron ()
(setq C (getpoint "Center: "))
(setq D (getdist "Diameter: "))
(command "circle" C D "")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Hinhchunhat ()
(setq A (getpoint "\n First pick: "))
(initget (+ 1 2 4))
(setq B (getreal "\n Length: "))
(initget (+ 1 2 4))
(setq C (getreal "\n width: "))
(setq A1 (polar A 0 B))
(setq A2 (polar A1 (/ pi 2) C))
(setq A3 (polar A (/ pi 2) C))
(command ".pline" A A1 A2 A3 "close")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(iniget 1 "Thang Tron Hinhchunhat")
(setq E (getkword "\n Choose Thang\Tron\Hinhchunhat: "))
(if (= E nil)(thang)
(= E "Tron") (tron)
(= E "Hinhchunhat") (Hinhchunhat)
)
)
-------------------------------
Please help me to correct my autolisp!
I want to set "Thang" is default and when I enter it will perfome defun "Thang" .
When I press T it will be "Tron", H it will be "Hinhchunhat"
I am a beginner, thank you very much for your replies!
Solved! Go to Solution.