简单的代码,qq群里有人问的,我学着写的,新手有抄袭的部分,呵呵下面是图片说明:
下面是代码:
- ;x正反方向移动带记忆,正数为正方向,负数为反方向
- (defun c:tt1 (/ Newmove ngc_snx ngc_ty)
- (setvar "CMDECHO" 0)
- (if *move* (setq Newmove (getreal (strcat "\n移动值<" (rtos *move* 2 2) ">:") ) )
- (setq Newmove (getreal "\n移动值:"))
- )
- (if (null Newmove) (setq Newmove *move*) (setq *move* Newmove))
- (setq ngc_snx (strcat (rtos *move* 2 2) ",0,0" )
- ngc_ty (ssget))
- (command ".move" ngc_ty "" "d" ngc_snx )
- (setvar "CMDECHO" 1)
- (princ)
- )
- ;y正反方向移动带记忆,正数为正方向,负数为反方向
- (defun c:tt2 (/ Newmove ngc_snx ngc_ty)
- (setvar "CMDECHO" 0)
- (if *move* (setq Newmove (getreal (strcat "\n移动值<" (rtos *move* 2 2) ">:") ) )
- (setq Newmove (getreal "\n移动值:"))
- )
- (if (null Newmove) (setq Newmove *move*) (setq *move* Newmove))
- (setq ngc_snx (strcat "0," (rtos *move* 2 2) ",0" )
- ngc_ty (ssget))
- (command ".move" ngc_ty "" "d" ngc_snx)
- (setvar "CMDECHO" 1)
- (princ)
- )
下面是文件,可以直接下载:
该贴已经同步到 hhh454的微博 |