本帖最后由 xyp1964 于 2019-12-18 13:04 编辑
- (defun c:cx ()
- (setq ukw (Ukword 1 "1 2" "1-垂线/2-中垂线" ukw))
- (while (setq s1 (entsel "\n选线: "))
- (setq pt (cadr s1)
- p2 (osnap pt "near")
- rr (angle pt p2)
- p2 (if (= ukw "1") p2 (osnap pt "mid"))
- p1 (polar p2 rr 1000)
- p3 (polar p2 rr -1000)
- )
- (command "line" "non" p1 "non" p3 "")
- )
- (princ)
- )
- (defun ukword (bit kwd msg def / inp) (if (and def (/= def ""))
- (setq msg (strcat "\n" msg "<" def ">: ")
- bit (* 2 (fix (/ bit 2)))
- )
- (setq msg (strcat "\n" msg ": "))
- )
- (initget bit kwd)
- (setq inp (getkword msg))
- (if inp inp def)
- )
|