我想你可以从我的提示和指点中找到答案。。。
无论如何,这里有一个例子:
- (if (null *command-reactor*)
- (setq *command-reactor*
- (vlr-command-reactor nil '((:vlr-commandwillstart . commandreactorcallback)))
- )
- )
- (if (null *editor-reactor*)
- (setq *editor-reactor*
- (vlr-editor-reactor nil '((:vlr-beginclose . editorreactorcallback)))
- )
- )
- (defun commandreactorcallback ( reactor params )
- (if (member (strcase (car params)) '("STYLE" "DIMSTYLE" "DDIM"))
- (if (setq *wsh* (cond (*wsh*) ((vlax-create-object "WScript.Shell"))))
- (vl-catch-all-apply 'vlax-invoke (list *wsh* 'sendkeys "{ESC}"))
- )
- )
- (princ)
- )
- (defun editorreactorcallback ( reactor params )
- (if (and *wsh* (eq 'VLA-OBJECT (type *wsh*)) (not (vlax-object-released-p *wsh*)))
- (vl-catch-all-apply 'vlax-release-object (list *wsh*))
- )
- (if (and *command-reactor* (eq 'VLA-OBJECT (type *command-reactor*)))
- (vlr-remove *command-reactor*)
- )
- (vlr-remove reactor)
- (princ)
- )
|