Lee Mac 发表于 2022-7-5 16:51:43

 
由于该点是命令修饰符(用于指示AutoCAD使用命令的标准定义),AutoCAD将仅读取该字符后面的输入(或该字符后面的任何命令修饰符)。
 
因此,由于无法避免此限制,作为替代方案,我建议用户输入“F4-5”表示“F4.5”,或输入“F0-45”/“F-45”表示“F0.45”。
 
我建议使用以下代码:
(   (lambda nil
       (vl-load-com)
       (foreach obj (cdar (vlr-reactors :vlr-command-reactor))
         (if (= "fillet-reactor" (vlr-data obj))
               (vlr-remove obj)
         )
       )
       (vlr-command-reactor "fillet-reactor" '((:vlr-unknowncommand . fillet-reactor-callback)))
   )
)
(defun fillet-reactor-callback ( obj com / rad )
   (if
       (and
         (setq com (vl-string-translate "-" "." (strcase (car com))))
         (wcmatch com "~*[~F.0-9]*")
         (wcmatch com "F*")
         (wcmatch com "~F*F*")
         (wcmatch com "~*.*.*")
         (setq rad (distof (substr com 2) 2))
         (<= 0.0 rad)
       )
       (progn
         (setvar 'filletrad rad)
         (vla-sendcommand fillet-reactor-acdoc "_.fillet ")
       )
   )
   (princ)
)
(or fillet-reactor-acdoc
   (setq fillet-reactor-acdoc (vla-get-activedocument (vlax-get-acad-object)))
)
(princ)至:
4

broncos15 发表于 2022-7-5 16:54:22

哇,这是一个简单的修复哈哈。谢谢李的帮助。那么,对于visual lisp命令,是否有额外的空间代替autolisp中使用的“”?

Lee Mac 发表于 2022-7-5 16:56:40

 
你很接近
 
 
一般来说,sendcommand方法执行的操作类似于用户在命令行手动键入提供的字符串参数(类似于脚本(.scr)的操作),因此空格或回车符可用于ENTER。

BIGAL 发表于 2022-7-5 16:59:39

这是有道理的,我想知道为什么它就像你输入了一个脚本文件。再次感谢您提供的信息和帮助,我非常感谢。

broncos15 发表于 2022-7-5 17:04:10

 
欢迎你来野马队,很乐意帮忙。

Lee Mac 发表于 2022-7-5 17:05:46

broncos15 发表于 2022-7-5 17:11:04

Wow, that was an easy fix haha. Thanks for the help Lee. So for visual lisp commands, does an extra space take the place of "" used in autolisp?

Lee Mac 发表于 2022-7-5 17:13:42

 
You were pretty close
 
 
Not in general - the sendcommand method is performing an operation similar to the user manually typing the supplied string argument at the command-line (similar to how Scripts (.scr) operate), therefore spaces or carriage returns can be used for ENTER.

broncos15 发表于 2022-7-5 17:17:18

That makes sense, I was wondering why it was like how you have enter for a script file. Thanks again for the information and the help with it, I appreciate it.

Lee Mac 发表于 2022-7-5 17:19:14

 
You're welcome broncos, happy to help.
页: 1 [2]
查看完整版本: Lisp表示圆角半径。