- (defun c:11 (/ *error* sset line1 line2)
- (defun *error*(msg)
- (if line1 (redraw line1 4)) ;取消亮显
- (if line2 (redraw line2 4)) ;取消亮显
- )
- (setq sset (ssget "I"))
- (if (and sset (= (sslength sset) 2))
- (progn
- (setq line1 (ssname sset 0))
- (setq line2 (ssname sset 1))
- (print "使用预先选择的线")
- )
- (progn
- ;; 提示用户选择两条线
- (setq line1 (car (entsel "\n请选择第一条线: ")))
- (redraw line1 3)
- (setq line2 (car (entsel "\n请选择第二条线: ")))
- (redraw line2 3)
- )
- )
- (princ))
|