明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1667|回复: 1

[函数] 求一个监视命令的反应器

[复制链接]
发表于 2013-9-10 13:07 | 显示全部楼层 |阅读模式
10明经币
求一个监视命令的反应器

"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2013-9-10 13:14 | 显示全部楼层
  1. (defun wx-cmd (x1 x2)
  2.   (setq        cmdstr (car x2))
  3.   (setq layer (getvar "CLAYER"))
  4.   (princ "\n开始命令:")
  5.   (if (= (strcase cmdstr t) "line")
  6.     (setq en (entlast)))
  7.   )
  8. (defun wx-cmd1 (x1 x2)
  9.   (princ "\n结束命令:")
  10.   (setq a1 x1 a2 x2)
  11.   (setvar "CLAYER" layer)
  12.   )
  13. (defun wx-cmd2 (x1 x2)
  14.   (princ "\n取消命令:")
  15.   (setq a1 x1 a2 x2)
  16.   (setvar "CLAYER" layer)
  17.   )
  18. (or :vlr-wx-cmd
  19.   (setq :vlr-wx-cmd (vlr-command-reactor nil (list
  20.                                              (cons :vlr-commandWillStart (function wx-cmd));开始命令
  21.                                              (cons :vlr-commandEnded (function wx-cmd1));结束命令
  22.                                              (cons :vlr-commandCancelled (function wx-cmd2));取消命令
  23.                                              )))
  24.   )
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-5 07:03 , Processed in 1.519621 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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