|
AnyCAD Rapid API 2026
Help you to create a better world!
|
命令执行上下文类 更多...
Public 成员函数 | |
| CommandContext (global::System.IntPtr cPtr, bool cMemoryOwn) | |
| 仅供内部使用 | |
| void | Dispose () |
| CommandContext () | |
| 默认构造函数 | |
| CommandContext (Viewer pViewer, Document pDoc, ParameterDict parameters) | |
| 构造命令上下文 | |
| Viewer | GetViewer () |
| void | SetViewer (Viewer val) |
| Document | GetDocument () |
| void | SetDocument (Document val) |
| ParameterDict | GetParameters () |
| void | SetParameters (ParameterDict val) |
| ParameterDict | GetOutput () |
| bool | GetClearPreviousEditor () |
| void | SetClearPreviousEditor (bool val) |
| string | GetErrorMessage () |
| void | SetErrorMessage (string val) |
| ObjectId | GetObjectId () |
| 获取当前输入的操作对象ID | |
| void | SetObjectId (ObjectId id) |
| 设置当前输入操作对象ID | |
| EnumEditorTrigger | GetTrigger () |
| 获取触发方式 | |
| SelectionManager | GetSelectionManager () |
| 获取当前选择集管理器 | |
| bool | IsBatchMode () |
| 检查是否为批处理模式 | |
命令执行上下文类
封装命令执行所需的所有环境信息,包括视图、文档、参数等。 提供统一的接口访问命令执行环境。
| AnyCAD.Foundation.CommandContext.CommandContext | ( | Viewer | pViewer, |
| Document | pDoc, | ||
| ParameterDict | parameters ) |
构造命令上下文
| pViewer | 视图对象指针 |
| pDoc | 文档对象指针 |
| parameters | 输入参数字典 |
| ObjectId AnyCAD.Foundation.CommandContext.GetObjectId | ( | ) |
获取当前输入的操作对象ID
用于跟踪用户当前选择的对象
| SelectionManager AnyCAD.Foundation.CommandContext.GetSelectionManager | ( | ) |
获取当前选择集管理器
| EnumEditorTrigger AnyCAD.Foundation.CommandContext.GetTrigger | ( | ) |
获取触发方式
| bool AnyCAD.Foundation.CommandContext.IsBatchMode | ( | ) |
检查是否为批处理模式
批处理模式下,带Editor的命令不进入Editor,直接执行
| void AnyCAD.Foundation.CommandContext.SetObjectId | ( | ObjectId | id | ) |
设置当前输入操作对象ID
| id | 对象ID |