本帖最后由 kucha007 于 2022-12-4 23:52 编辑
水平OR垂直镜像,加了循环可以一直选对象- (defun c:TT (/ ss pt1 pt2)
- (while
- (defun *error* ( msg );定义出错函数
- (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))
- (progn
- (princ (strcat "\n错误: " msg))
- (command "redraw")
- (princ)
- )
- )
- )
- (if (ssget "i")
- (setq ss (ssget))
- (progn
- (princ "\n→请选择需镜像的对象:")
- (setq ss (ssget))
- )
- )
- (if ss
- (progn
- (if (not tymir)(setq tymir 1)) ;1垂直,-1统一
- (setq pt1 "S")
- (while (= pt1 "S");取值
- (initget "S s")
- (if (= "S" (setq pt1 (getpoint (strcat "\n→请选择("(if (= tymir 1) "垂直" "水平")")轴上的点"":[切换S]"))))
- (setq tymir (* -1 tymir)) ;1/-1
- )
- )
- (if pt1
- (progn
- (if (= tymir 1)
- (setq pt2 (list (+ (car pt1) 0) (+ (cadr pt1) 10000)))
- (setq pt2 (list (+ (car pt1) 10000) (+ (cadr pt1) 0)))
- )
- (command "_.MIRROR" ss "" pt1 pt2 "N")
- )
- )
- )
- )
- (command "redraw")
- (princ)
- )
- )
|