xml.Revit.Templates 1.5.2

There is a newer version of this package available.
See the version list below for details.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet new install xml.Revit.Templates::1.5.2                
This package contains a .NET Template Package you can call from the shell/command line.

.Net 平台上快速为 Revit 创建插件

Nuget Downloads Last Commit

该模板包含用于快速创建 Revit 附加命令的项目模板

默认支持Revit版本18~25

推荐使用拓展包 https://www.nuget.org/packages/xml.Revit.Toolkit

Installation

  1. 安装 .Net SDK
  2. 运行 dotnet new install xml.Revit.Templates 安装更新项目模板

安装完成后

启动 Visual Studio 2022

新建项目中找到 xml.Revit.Templates 模板输入项目名称完成项目创建

编译通过则安装完成并正确使用可以在这个模板下愉快的写代码咯

code snipate

创建代码片段快速创建Revit命令

打开文件夹

C:\Program Files\Microsoft Visual Studio\2022\Community\VC#\Snippets\2052\Visual C#

在文件夹内新建 xmlRevitCmd.snippet 文件并粘贴下方全部内容到此文件中后保存

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
 <CodeSnippet Format="1.0.0">
  <Header>
   <Title>xmlRevitCmd</Title>
   <Shortcut>xmlRevitCmd</Shortcut>
   <Description>xml Revit Command 的代码片段</Description>
   <Author>xml</Author>
   <SnippetTypes>
    <SnippetType>Expansion</SnippetType>
    <SnippetType>SurroundsWith</SnippetType>
   </SnippetTypes>
  </Header>
  <Snippet>
   <Declarations>
    <Literal>
     <ID>name</ID>
     <ToolTip>请输入功能类名</ToolTip>
     <Default>Test</Default>
    </Literal>
   </Declarations>
   <Code Language="csharp"><![CDATA[
    [Xml("$name$")]
    [Transaction(TransactionMode.Manual)]
    internal sealed class Cmd$name$ : XmlExternalCommand
    {
     protected override void Execute(ref string message, ElementSet elements)
     {
      XmlDoc.Print(uidoc.Document.Title);
     }
    }
   ]]>
   </Code>
  </Snippet>
 </CodeSnippet>
</CodeSnippets>

重新启动 Visual Studio 2022

输入 xmlRevitCmd命令可快速创建Revit功能命令

<p align="left"> <picture> <source media="(prefers-color-scheme: dark)" width="750" srcset="https://raw.githubusercontent.com/ZedMoster/xml.Revit.Templates/main/assets/xmlRevitCommand.gif"> <img alt="xmlRevitCommand" width="750" src="https://raw.githubusercontent.com/ZedMoster/xml.Revit.Templates/main/assets/xmlRevitCommand.gif"> </picture> </p>

  • net8.0

    • 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.

Version Downloads Last updated
1.6.0 87 12/31/2024