AnyCAD Rapid API 2026
Help you to create a better world!
载入中...
搜索中...
未找到
AnyCAD.Foundation.Command类 参考

命令基类 更多...

类 AnyCAD.Foundation.Command 继承关系图:
AnyCAD.Designing.PrimitiveCommand AnyCAD.Foundation.EditorCommand

Public 成员函数

 Command (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
 
void Dispose ()
 
 Command ()
 默认构造函数
 
string GetName ()
 
void SetName (string val)
 
bool GetHasEditor ()
 
void SetHasEditor (bool val)
 
bool GetNeedViewer ()
 
void SetNeedViewer (bool val)
 
string GetDescription ()
 
void SetDescription (string val)
 
string GetURI ()
 
void SetURI (string val)
 
EnumCommandBehavior GetCommandType ()
 
virtual string GetUIName ()
 获取UI显示名称
 
virtual void QueryParamsSchema (CommandContext ctx)
 查询命令的输入参数Schema
 
bool Execute (CommandContext ctx, bool notify)
 执行命令
 
virtual string Query (CommandContext ctx)
 查询命令
 
virtual bool IsVisible (CommandContext ctx)
 检查命令是否可见
 
virtual bool IsChecked (CommandContext ctx)
 检查命令是否处于选中状态
 
virtual bool BeforeRunning (CommandContext ctx)
 执行前检查
 
void ShowToolTip (string message)
 显示提示信息
 

静态 Public 成员函数

static bool Redirect (string name, CommandContext ctx)
 重定向到其他命令
 

详细描述

命令基类

所有命令的抽象基类,定义命令的生命周期和行为。 支持交互式执行和批处理模式,可关联编辑器实现复杂交互。

成员函数说明

◆ BeforeRunning()

virtual bool AnyCAD.Foundation.Command.BeforeRunning ( CommandContext ctx)
virtual

执行前检查

参数
ctx上下文
返回
true 表示可以执行,false 表示不可执行

在执行命令之前进行前置条件验证

◆ Execute()

bool AnyCAD.Foundation.Command.Execute ( CommandContext ctx,
bool notify )

执行命令

参数
ctx上下文信息
notify是否通知监听器
返回
true 表示执行成功

◆ GetUIName()

virtual string AnyCAD.Foundation.Command.GetUIName ( )
virtual

获取UI显示名称

返回
返回适合在界面显示的命令名称

AnyCAD.Designing.PrimitiveCommand 重载.

◆ IsChecked()

virtual bool AnyCAD.Foundation.Command.IsChecked ( CommandContext ctx)
virtual

检查命令是否处于选中状态

参数
ctx上下文
返回
true 表示命令仍在执行状态

◆ IsVisible()

virtual bool AnyCAD.Foundation.Command.IsVisible ( CommandContext ctx)
virtual

检查命令是否可见

参数
ctx上下文
返回
true 表示命令可以显示和执行

◆ Query()

virtual string AnyCAD.Foundation.Command.Query ( CommandContext ctx)
virtual

查询命令

参数
ctx上下文
返回
查询结果(JSON格式字符串)

◆ QueryParamsSchema()

virtual void AnyCAD.Foundation.Command.QueryParamsSchema ( CommandContext ctx)
virtual

查询命令的输入参数Schema

参数
ctx命令上下文

将参数Schema保存在Output中,用于自动生成UI

◆ Redirect()

static bool AnyCAD.Foundation.Command.Redirect ( string name,
CommandContext ctx )
static

重定向到其他命令

参数
name目标命令名称
ctx命令上下文
返回
true 表示重构成功

◆ ShowToolTip()

void AnyCAD.Foundation.Command.ShowToolTip ( string message)

显示提示信息

参数
message提示内容