本帖最后由 作者 于 2008-11-28 10:10:15 编辑
问题解决: (defun c:test( / asc get go real return) (setq go T) (print "输入实数") (while (and go (setq get (grread T))) (if (and (= (car get) 2) (setq asc (cadr get)) (/= asc 47) (>= asc 46) (<= asc 57)) (progn (setq ws (vlax-Create-Object "WScript.Shell")) (setq real (getreal (car (list "" (vlax-invoke-method ws 'sendkeys (chr asc)))))) (if real (setq go nil)) ) ) ) real ) |