Hybh.RevitAPI.Toolkit 1.2.0

Suggested Alternatives

RevitAPI.Toolkit

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Hybh.RevitAPI.Toolkit --version 1.2.0                
NuGet\Install-Package Hybh.RevitAPI.Toolkit -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="Hybh.RevitAPI.Toolkit" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hybh.RevitAPI.Toolkit --version 1.2.0                
#r "nuget: Hybh.RevitAPI.Toolkit, 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.
// Install Hybh.RevitAPI.Toolkit as a Cake Addin
#addin nuget:?package=Hybh.RevitAPI.Toolkit&version=1.2.0

// Install Hybh.RevitAPI.Toolkit as a Cake Tool
#tool nuget:?package=Hybh.RevitAPI.Toolkit&version=1.2.0                

Revit 快速开发

安装

可以使用 nuget package 安装.

<PackageReference Include="Hybh.RevitAPI.Toolkit" Version="*" />

简介

目录

External command

HybhRevitCommand 类实现了 IExternalCommand 接口.

可以自动监控 Autodesk.Revit.Exceptions.OperationCanceledException 操作.

    [Hybh("测试")]
    [Transaction(TransactionMode.Manual)]
    public class CmdTest : HybhRevitCommand
    {
        protected override void Execute(ref string message, ElementSet elements)
        {
            // 弹窗打印当前项目名称
            XmlDoc.Print(uidoc.Document.Title);
        }
    }

External Application

获取程序集目录下类库中包含全部的 HybhAttribute 特性的功能,添加功能区面板

dll生成目录下 Resources 目录存放功能图标文件,格式 .png

  • 测试.png
  • 测试_16.png

为自定义功能图标则统一设置为默认图标

    internal class App : HybhExternalApplication
    {
        public override string TabName => "快速开发";

        public override void OnStartup()
        {
            XmlDoc.Instance.UIapp = UIapp;
            var panel = ControlledApplication.CreatePanel(TabName, TabName);

            // 添加功能
            var pushButtonDatas = HybhAttributeCmds.OrderBy(o => o.GetCustomAttribute<HybhAttribute>().Name)
                .Select(o => o.GetPushButtonData());
            foreach (var item in pushButtonDatas)
            {
                panel.AddPushButton(item);
            }

            // 使插件仅项目文档可见
            XmlDoc.Instance.UIapp.Application.ApplicationInitialized += Application_ApplicationInitialized_ControlHelperExtension;
        }
    }

Transaction

实现事务及事务组拓展方法

事务
    doc.Transaction(t =>
    { 
        // doc.Delete(wall.Id);

    }, "事务名称");
事务组
    doc.TransactionGroup(tg =>
    {
        doc.Transaction(t =>
        { 
            // doc.Delete(wall.Id);

        });
        doc.Transaction(t =>
        { 
            // doc.Delete(window.Id);

        });
    }, "事务组名称");

Extensions

自定义拓展方法实现快速开发

添加命令空间引用

using Hybh.RevitAPI.Toolkit.Extensions

可使用下方拓展方法

  • ConvertExtensions
  • CurveExtensions
  • DocumentExtensions
  • ElementExtensions
  • ElementIdExtensions
  • ImageExtensions
  • MEPCurveExtensions
  • ReferenceExtensions
  • RoomExtensions
  • StringExtensions
  • TransactionExtensions
  • TypeExtensions
  • UIControlledApplicationExtensions
  • XYZExtensions
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  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.2

    • 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