CopilotForDesign.Contracts.Revit
1.2.0
dotnet add package CopilotForDesign.Contracts.Revit --version 1.2.0
NuGet\Install-Package CopilotForDesign.Contracts.Revit -Version 1.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CopilotForDesign.Contracts.Revit" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CopilotForDesign.Contracts.Revit" Version="1.2.0" />
<PackageReference Include="CopilotForDesign.Contracts.Revit" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CopilotForDesign.Contracts.Revit --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CopilotForDesign.Contracts.Revit, 1.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CopilotForDesign.Contracts.Revit@1.2.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CopilotForDesign.Contracts.Revit&version=1.2.0
#tool nuget:?package=CopilotForDesign.Contracts.Revit&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CopilotForDesign.Contracts.Revit
Copilot for Design 的 Revit 命令开发契约库。编译时元数据标注 + 运行时事件总线。
安装
Install-Package CopilotForDesign.Contracts.Revit
包含
| 类型 | 作用 |
|---|---|
CommandAttribute |
标注 IExternalCommand 类,声明命令元数据(标题、描述、触发条件、专业等) |
CommandInputAttribute |
标注 Parameters 属性,指明入参反序列化目标类型 |
AppEventHub |
运行时全局事件总站,命令执行完成后回传结果 |
输入约束声明
不要手写或篡改 Executor 生成的 JSON Schema。需要表达机器可读约束时,在 InputParams 属性上使用:
[Required, MinItems(1), UniqueItems]
public List<int> element_ids { get; set; } = null!;
[AllowedValues(5, 10, 50, 100)]
public int rounding_mm { get; set; } = 10;
[RequiredWhen(nameof(scope), "selected")]
public List<int> selected_ids { get; set; } = new();
对应生成 minItems、uniqueItems、数值或字符串 enum、if/then 条件 required。嵌套 DTO 上的 [Required] 也会保留到嵌套 Schema。
using SharedLibrary;
[Command(
Title = "元素查询",
Description = "根据类别和属性条件筛选 Revit 模型元素",
Trigger = "当需要查询、搜索、过滤 Revit 元素时调用",
Discipline = "general"
)]
public class MyCommand : IExternalCommand
{
[CommandInput(typeof(MyRequest))]
public JObject Parameters { get; set; }
public Result Execute(...)
{
// 你的逻辑
AppEventHub.RaiseCommandCompleted(nameof(MyCommand), true, resultJson);
return Result.Succeeded;
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net47 is compatible. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.