PostCommand 方法 (ActiveX)
将命令字符串发布到文档,以便在文档进入空闲状态时执行。 支持的平台:仅限 Windows 返回值 (RetVal)无返回值。 言论在命令字符串末尾使用空格或 ASCII 回车符 () 结束命令;这相当于按键盘上的 Enter。vbCr 此方法处理任何 AutoCAD 命令行函数,包括 AutoLISP 表达式。 如果文档未处于活动状态,则文档将处于激活状态,并在文档具有焦点时执行字符串。 此方法是异步的。如果需要同步执行命令字符串,请使用该方法。SendCommand 例子VBA: Sub Example_PostCommand() ' This example sends a command for evaluation to the AutoCAD Command prompt ' of the current drawing ' Start creating a Circle in the active drawing ThisDrawing.PostCommand "._circle" & vbCr & "2,2,0" & vbCr MsgBox "CIRCLE command has been started, enter a radius to finish the command." End Sub 可视化 LISP: (vl-load-com) (defun c:Example_PostCommand() ;; This example sends a command for evaluation to the AutoCAD Command prompt ;; of the current drawing (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Start creating a Circle in the active drawing (vla-PostCommand doc "._circle 2,2,0 ") (alert "CIRCLE command has been started, enter a radius to finish the command.") ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 12:44
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.