xml.Revit.Toolkit 2025.3.2

dotnet add package xml.Revit.Toolkit --version 2025.3.2
NuGet\Install-Package xml.Revit.Toolkit -Version 2025.3.2
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="xml.Revit.Toolkit" Version="2025.3.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add xml.Revit.Toolkit --version 2025.3.2
#r "nuget: xml.Revit.Toolkit, 2025.3.2"
#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.
// Install xml.Revit.Toolkit as a Cake Addin
#addin nuget:?package=xml.Revit.Toolkit&version=2025.3.2

// Install xml.Revit.Toolkit as a Cake Tool
#tool nuget:?package=xml.Revit.Toolkit&version=2025.3.2

xml.Revit.Toolkit

Autodesk Revit 2020 - 2024

Install

安装 2024 <PackageReference Include="xml.Revit.Toolkit" Version="2024.*-*" />

安装 2023 <PackageReference Include="xml.Revit.Toolkit" Version="2023.*-*" />

安装 2022 <PackageReference Include="xml.Revit.Toolkit" Version="2022.*-*" />

安装 2021 <PackageReference Include="xml.Revit.Toolkit" Version="2021.*-*" />

安装 2020 <PackageReference Include="xml.Revit.Toolkit" Version="2020.*-*" />

Technologies Used

  • C# 12
  • .NET Framework 4.8
  • .NET 8
RevitTask

可使用取消任务令牌 CancellationTokenSource

/* 作    者: xml
** 创建时间: 2024/2/16 20:26:06
**
** Copyright 2024 by zedmoster
** Permission to use, copy, modify, and distribute this software in
** object code form for any purpose and without fee is hereby granted,
** provided that the above copyright notice appears in all copies and
** that both that copyright notice and the limited warranty and
** restricted rights notice below appear in all supporting
** documentation.
*/

using System.Diagnostics;
using Autodesk.Revit.DB;
using xml.Revit.Toolkit.Attributes;
using xml.Revit.Toolkit.Extensions;
using xml.Revit.Toolkit.Utils;

namespace xml.Revit.Dev
{
    [Xml("TaskRevit", "测试 TaskRevit")]
    [Transaction(TransactionMode.Manual)]
    public class Cmd : XmlExternalCommand
    {
        protected override void Execute(ref string message, ElementSet elements)
        {
            Task.Run(async () =>
            {
                var source = new CancellationTokenSource(80);
                var token = source.Token;
                try
                {
                    await XmlDoc.Instance.RevitTask.RunAsync(
                        () =>
                        {
                            var doc = uidoc.Document;
                            doc.Transaction(
                                t =>
                                {
                                    for (int i = 0; i < 100; i++)
                                    {
                                        if (token.IsCancellationRequested)
                                            return;
                                        var detailArc = doc.CreateDetailArc(XYZ.BasisX * i);
                                        Debug.Write(detailArc.Id);
                                    }
                                },
                                "Task token"
                            );
                        },
                        token
                    );
                }
                finally
                {
                    source.Dispose();
                }
            });
        }
    }
}

ProgressBarWindow

如何使用简单的任务进度条

/* 作    者: xml
** 创建时间: 2024/4/19 20:26:06
**
** Copyright 2024 by zedmoster
** Permission to use, copy, modify, and distribute this software in
** object code form for any purpose and without fee is hereby granted,
** provided that the above copyright notice appears in all copies and
** that both that copyright notice and the limited warranty and
** restricted rights notice below appear in all supporting
** documentation.
*/

using Autodesk.Revit.DB;
using xml.Revit.Toolkit.Attributes;
using xml.Revit.Toolkit.Extensions;
using xml.Revit.Toolkit.Utils;
using xml.Revit.Toolkit.Views;

namespace xml.Revit.Dev
{
    [Xml("测试进度条")]
    [Transaction(TransactionMode.Manual)]
    public sealed class Cmd : XmlExternalCommand
    {
        protected override void Execute(ref string message, ElementSet elements)
        {
            var doc = uidoc.Document;

            using var progressBarView = new ProgressBarWindow();
            doc.TransactionGroup(tg =>
            {
                progressBarView.Run(
                    Enumerable.Range(0, 100),
                    i =>
                    {
                        var pnt = XYZ.BasisX * i;
                        doc.Transaction(t => doc.CreateDetailArc(pnt));
                        Thread.Sleep(50);
                    }
                );
            });
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2025.3.2 73 4/19/2024
2025.3.1 100 4/9/2024
2025.3.0 93 4/7/2024
2025.2.16 90 4/7/2024
2025.2.15 87 4/7/2024
2024.3.2 66 4/19/2024
2024.3.1 87 4/9/2024
2024.3.0 92 4/7/2024
2024.2.16 96 4/7/2024
2024.2.15 82 4/3/2024
2024.2.14 115 3/31/2024
2024.2.13 118 3/28/2024
2024.2.12 123 3/23/2024
2024.2.11 128 3/23/2024
2024.2.10 164 3/9/2024
2024.2.9 169 3/7/2024
2024.2.8 200 3/3/2024
2024.2.7 202 3/3/2024
2024.2.0 216 2/16/2024
2023.3.2 66 4/19/2024
2023.3.1 86 4/9/2024
2023.3.0 79 4/7/2024
2023.2.16 83 4/7/2024
2023.2.15 100 4/3/2024
2023.2.14 97 3/31/2024
2023.2.13 126 3/28/2024
2023.2.12 112 3/23/2024
2023.2.11 122 3/23/2024
2023.2.10 164 3/9/2024
2023.2.9 155 3/7/2024
2023.2.8 174 3/3/2024
2023.2.7 159 3/3/2024
2023.2.6 175 3/2/2024
2023.2.5 186 2/24/2024
2023.2.4 197 2/24/2024
2023.2.3 187 2/19/2024
2023.2.2 196 2/19/2024
2023.2.1 199 2/19/2024
2023.2.0 205 2/16/2024
2022.3.2 62 4/19/2024
2022.3.1 94 4/9/2024
2022.3.0 86 4/7/2024
2022.2.16 79 4/7/2024
2022.2.15 82 4/3/2024
2022.2.14 110 3/31/2024
2022.2.13 110 3/28/2024
2022.2.12 112 3/23/2024
2022.2.11 140 3/23/2024
2022.2.10 159 3/9/2024
2022.2.9 161 3/7/2024
2022.2.8 169 3/3/2024
2022.2.7 180 3/3/2024
2022.2.6 179 3/2/2024
2022.2.5 195 2/24/2024
2022.2.4 189 2/24/2024
2022.2.3 182 2/19/2024
2022.2.2 218 2/19/2024
2022.2.1 213 2/19/2024
2022.2.0 197 2/16/2024
2021.3.2 66 4/19/2024
2021.3.1 89 4/9/2024
2021.3.0 86 4/7/2024
2021.2.16 84 4/7/2024
2021.2.15 81 4/3/2024
2021.2.14 106 3/31/2024
2021.2.13 113 3/28/2024
2021.2.12 108 3/23/2024
2021.2.11 123 3/23/2024
2021.2.10 159 3/9/2024
2021.2.9 153 3/7/2024
2021.2.8 181 3/3/2024
2021.2.7 177 3/3/2024
2021.2.6 166 3/2/2024
2021.2.5 180 2/24/2024
2021.2.4 205 2/24/2024
2021.2.3 198 2/19/2024
2021.2.2 202 2/19/2024
2021.2.1 216 2/19/2024
2021.2.0 189 2/16/2024
2020.3.2 66 4/19/2024
2020.3.1 96 4/9/2024
2020.3.0 90 4/7/2024
2020.2.16 88 4/7/2024
2020.2.15 85 4/3/2024
2020.2.14 111 3/31/2024
2020.2.13 111 3/28/2024
2020.2.12 107 3/23/2024
2020.2.11 124 3/23/2024
2020.2.10 149 3/9/2024
2020.2.9 145 3/7/2024
2020.2.8 171 3/3/2024
2020.2.7 169 3/3/2024
2020.2.6 180 3/2/2024
2020.2.5 186 2/24/2024
2020.2.4 196 2/24/2024
2020.2.3 217 2/19/2024
2020.2.2 209 2/19/2024
2020.2.1 202 2/19/2024
2020.2.0 206 2/16/2024