明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 298|回复: 3

lisp函数响应键盘上下左右移动

  [复制链接]
发表于 2024-3-29 17:51 | 显示全部楼层 |阅读模式
(defun c:mm ()
  (setvar "cmdecho" 0)
  (setq ss(ssget))
  (princ "\N左移4,右移6,上移8,下移2")
  (setq loop T)
  (while loop
    (setq h(*(/(getvar "viewsize")(cadr(getvar "screensize")))(/(getvar "pickbox")2)))
    (cond
     ((=(car(grread T 5 2))50))
     ((=(cadr(grread T 5 2))52)(command "MOVE" ss "" "non" (LIST h 0 0) "non" '(0 0 0)))
     ((=(cadr(grread T 5 2))54)(command "MOVE" ss "" "non" '(0 0 0) "non" (LIST(* h 2)0 0)))
     ((=(cadr(grread T 5 2))50)(command "MOVE" ss "" "non" (LIST 0 h 0) "non" '(0 0 0)))
     ((=(cadr(grread T 5 2))56)(command "MOVE" ss "" "non" '(0 0 0) "non" (LIST 0 (* h 2) 0)))
  ) )
(princ))

发表于 2024-3-30 11:57 | 显示全部楼层
很实用的功能,感谢楼主分享
发表于 2024-3-31 21:19 | 显示全部楼层
52 54 50 56 这些值在哪里查?
发表于 2024-4-1 16:20 来自手机 | 显示全部楼层
感谢分享,试试看看
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-28 05:44 , Processed in 0.284249 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表