
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
(defun C:TH ()
(setq A (getpoint "\n Specify first corner of rectangle: "))
(initget (+ 1 2 4))
(setq B (getreal "\n Specify length: "))
(initget (+ 1 2 4))
(setq C (getreal "\n Specify width: "))
(initget (+ 1 2 4))
(setq L1 (getreal "\n Offset from the left side: "))
(initget (+ 1 4))
(setq L2 (getreal "\n Offset from first circle: "))
(initget (+ 1 2 4))
(initget 0 "Piasu Ponchi")
(setq F (getreal "\n Specify diameter or [Piasu/Ponchi]: "))
(setvar "cmdecho" 0)
(setq osv (getvar "osmode"))
(setvar "osmode" 0)
(setq A2 (polar A 0 B))
(setq A3 (polar A2 (/ pi 2) C))
(setq A4 (polar A (/ pi 2) C))
(setq A5 (polar A 0 L1))
(setq C1 (polar A5 (/ pi 2) (/ C 2)))
(setq C2 (polar C1 0 L2))
(command "CLAYER" "11")
(command ".pline" A A2 A3 A4 "close")
(setvar "regenmode" 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (= (numberp F) T)
(command ".circle" C1 "_d" F "" ".circle" C2 "_d" F "")
(progn
(cond
((eq F "Piasu") ((command "CLAYER" "66") (command ".point" C1 "" ".point" C2 "") (command "CLAYER" "11")))
((eq F "Ponchi") ((command "CLAYER" "33") (command ".point" C1 "" ".point" C2 "") (command "CLAYER" "11")))
)
)
(setvar "osmode" osv)
(setvar "cmdecho" 1)
)
)
------------------------------------------
Draw rectangle with 2 holes (2 points), when I choose Piasu(a point) it will make a point with layer 66(mylayer), and Ponchi(a point) it will make a point with layer 33(mylayer), I have tried my codes but it is error at create (Piasu and Ponchi), After change to layer 33 or 66 it will set currentlayer is 11. Is there wrong with my lisp?
Solved! Go to Solution.