本帖最后由 weiqi 于 2013-6-3 20:12 编辑
- (defun c:fz ()
- (prompt "\n请选择复制旋转的对象:")
- (if (and (setq ss (ssget))
- (setq pt (getpoint "\n选择基点:"))
- )
- (c:qq)
- )
- )
- (defun c:qq ()
- (setq la (entlast))
- (princ "\n请指点目标点:")
- (command "copy" ss "" pt pause)
- (setq newss (ssadd))
- (while (setq la (entnext la)) (ssadd la newss))
- (princ "\n指定旋转角度或 [参照(R)]:")
- ;;(command "rotate" newss "" "non" "@" pause)
- (SETQ SSet1 newss)
- (XZ)
- )
-
- ;;; ----------------------------------------------------------------------------
- ;;; ---------------------- = = = = 主 函 数 = = = = ------------------------
- ;;; ----------------------------------------------------------------------------
- ;;; ( 通过键盘旋转目标 )
- ;;; ----------------------------------------------------------------------------
- (DEFUN xz (/ cmd loop SSet KeyList n step BasePoint0 BasePoint1 BasePoint2)
- (SETQ cmd (GETVAR "CMDECHO"))
- (SETVAR "CMDECHO" 0)
- (SETQ loop 1)
- (WHILE loop
- (PROMPT "\n 选择对象 : ")
- (SETQ SSet (ssget "l"))
- (COND
- ((NULL SSet)(ALERT "没有选中对象!"))
- (T (SETQ loop nil))
- )
- )
- (setq p1 (getpoint "指定基点: "))
- (PRINC "\n Press key:")
- (PRINC "\n\t 《1键- 1度》《2键-1度》《Q键 15度》《W键 -15度》《E键 45度》 ")
- (PRINC "\n\t 《A键 90度》《E键 -90度》 《D键 180度》")
- (TERPRI)
- (SETQ KeyList '(32 49 50 65 68 81 83 87 119 101 113 32 115 97 100))
- (WHILE (/= (SETQ n (CADR (GRREAD))) 13)
- (if (MEMBER n KeyList)
- (COND
- ((= n 49)(COMMAND "ROTATE" SSet "" p1 1)(PRINC "\r< +1度 >"))
- ((= n 50)(COMMAND "ROTATE" SSet "" p1 -1)(PRINC "\r< -1度 >"))
- ((= n 113)(COMMAND "ROTATE" SSet "" p1 15)(PRINC "\r< q 15度 >"))
- ((= n 81)(COMMAND "ROTATE" SSet "" p1 15)(PRINC "\r< Q 15度 >"))
- ((= n 119)(COMMAND "ROTATE" SSet "" p1 -15)(PRINC "\r< w -15度 >"))
- ((= n 87)(COMMAND "ROTATE" SSet "" p1 -15)(PRINC "\r< W -15度 >"))
- ((= n 101)(COMMAND "ROTATE" SSet "" p1 45)(PRINC "\r< e 45度 >"))
- ((= n 69)(COMMAND "ROTATE" SSet "" p1 45)(PRINC "\r< E 45度 >"))
- ((= n 115)(COMMAND "ROTATE" SSet "" p1 -90)(PRINC "\r< s -90度 >"))
- ((= n 83)(COMMAND "ROTATE" SSet "" p1 -90)(PRINC "\r< S -90度 >"))
- ((= n 97) (COMMAND "ROTATE" SSet "" p1 90)(PRINC "\r< a 90度>"))
- ((= n 65) (COMMAND "ROTATE" SSet "" p1 90)(PRINC "\r< A 90度>"))
- ((= n 100)(COMMAND "ROTATE" SSet "" p1 180)(PRINC "\r< d 180度>"))
- ((= n 68)(COMMAND "ROTATE" SSet "" p1 180)(PRINC "\r< D 180度>"))
- ((= n 32)(COMMAND "ROTATE" SSet "" p1 -45)(PRINC "\r<空格 -45度>"))
- )
- )
- );WHILE
- (SETVAR "CMDECHO" cmd)
- (PRINC)
- )
- (PRINC "按键旋转1 2 q w e a s d 命令XZ ")
有几个问题,(ssget "l") 怎么是多个对象
|