您也可以使用命令begin reactor。
快速示例:
- ;; COMMAND REACTORS
- (or *startcommandreactor*
- (setq *startcommandreactor* (vlr-command-reactor nil '((:vlr-commandwillstart . strtcmd))))
- )
- ;; List of commands to fire reactors (set layers textstyle etc...)
- (setq *commands* "dim*,*table*,*xref,xattach,mview,*vports,*image*,*hatch,*leader,*text,saveas")
- (defun strtcmd (calling-reactor strtcmdinfo / cs name)
- (setq cs (strcase (car strtcmdinfo) t))
- (if (wcmatch cs *commands*)
- (progn (cond ;; (replace the (print "*") with your code that does cool stuff
- ((wcmatch cs "saveas") (print "Saveas"))
- ((wcmatch cs "dim*") (print "Dimension"))
- ((wcmatch cs "*table*") (print "Table"))
- ((wcmatch cs "*xref,xattach") (print "Xref"))
- ((and (wcmatch cs "mview,*vports")) (print "Viewport"))
- ((wcmatch cs "*image*") (print "Image"))
- ((wcmatch cs "*hatch") (print "Hatch"))
- ((wcmatch cs "mleader") (print "Mleader"))
- ((wcmatch cs "*leader") (print "Leader"))
- ((wcmatch cs "*text") (print "Text"))
- )
- )
- )
- )
|