CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

后命令方法 (ActiveX)

2023-1-4 05:00| 发布者: admin| 查看: 519| 评论: 0|来自: AutoCAD

摘要: 将命令字符串发布到文档,以便在文档进入空闲状态时执行。

将命令字符串发布到文档,以便在文档进入空闲状态时执行。

支持的平台:仅窗口

签名

工 务 局:

object.PostCommand Command
对象

类型:文档

此方法适用的对象。

命令

访问:仅输入

类型:字符串

要发布的命令字符串。

返回值(RetVal)

无返回值。

言论

在命令字符串末尾使用空格或 ASCII 回车符 () 结束命令;这相当于按键盘上的回车键。vbCr

此方法处理任何 AutoCAD 命令行函数,包括 AutoLISP 表达式。

如果文档未处于活动状态,则会激活文档,并在文档具有焦点时执行字符串。

此方法是异步的。如果需要同步执行命令字符串,请使用该方法。SendCommand

例子

工 务 局:

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

Visual 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.")
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-12 07:40

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部