Autodesk.PackageBuilder
1.0.6
dotnet add package Autodesk.PackageBuilder --version 1.0.6
NuGet\Install-Package Autodesk.PackageBuilder -Version 1.0.6
<PackageReference Include="Autodesk.PackageBuilder" Version="1.0.6" />
paket add Autodesk.PackageBuilder --version 1.0.6
#r "nuget: Autodesk.PackageBuilder, 1.0.6"
// Install Autodesk.PackageBuilder as a Cake Addin #addin nuget:?package=Autodesk.PackageBuilder&version=1.0.6 // Install Autodesk.PackageBuilder as a Cake Tool #tool nuget:?package=Autodesk.PackageBuilder&version=1.0.6
Autodesk.PackageBuilder
This package is intended to build Autodesk PackageContent.xml
and RevitAddin.addin
using C# fluent API.
Examples
Create PackageContents.xml
To get the PackageContents.xml
like this:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage SchemaVersion="1.0" ProductType="Application" AutodeskProduct="Revit" Name="RevitAddin" AppVersion="1.0.0">
<CompanyDetails Name="Company Name" Email="email" Url="url" />
<Components Description="Revit 2021">
<RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2021" SeriesMax="R2021" />
<ComponentEntry AppName="RevitAddin" ModuleName="./Contents/2021/RevitAddin.addin" />
</Components>
<Components Description="Revit 2022">
<RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2022" SeriesMax="R2022" />
<ComponentEntry AppName="RevitAddin" ModuleName="./Contents/2022/RevitAddin.addin" />
</Components>
</ApplicationPackage>
Inherit your builder class from PackageContentsBuilder
base class.
public class DemoPackageBuilder : PackageContentsBuilder
{
public DemoPackageBuilder()
{
ApplicationPackage
.Create()
.ProductType(ProductTypes.Application)
.AutodeskProduct(AutodeskProducts.Revit)
.Name("RevitAddin")
.AppVersion("1.0.0");
CompanyDetails
.Create("Company Name")
.Email("email")
.Url("url");
Components
.CreateEntry("Revit 2021")
.OS("Win64")
.Platform("Revit")
.SeriesMin("R2021")
.SeriesMax("R2021")
.AppName("RevitAddin")
.ModuleName(@"./Contents/2021/RevitAddin.addin");
Components
.CreateEntry("Revit 2022")
.RevitPlatform(2022)
.AppName("RevitAddin")
.ModuleName(@"./Contents/2022/RevitAddin.addin");
}
}
Or use BuilderUtils.Build<PackageContentsBuilder>()
.
var builder = BuilderUtils.Build<PackageContentsBuilder>(builder =>
{
builder.ApplicationPackage
.Create()
.ProductType(ProductTypes.Application)
.AutodeskProduct(AutodeskProducts.Revit)
.Name("RevitAddin")
.AppVersion("1.0.0");
builder.CompanyDetails
.Create("Company Name")
.Email("email")
.Url("url");
builder.Components
.CreateEntry("Revit 2021")
.OS("Win64")
.Platform("Revit")
.SeriesMin("R2021")
.SeriesMax("R2021")
.AppName("RevitAddin")
.ModuleName(@"./Contents/2021/RevitAddin.addin");
builder.Components
.CreateEntry("Revit 2022")
.RevitPlatform(2022)
.AppName("RevitAddin")
.ModuleName(@"./Contents/2022/RevitAddin.addin");
});
Getting results
String result
var builder = new DemoPackageBuilder();
var result = builder.ToString();
.xml file
var builder = new DemoPackageBuilder();
builder.Build("PackageContents.xml");
// or
BuilderUtils.Build<DemoPackageBuilder>("PackageContents.xml");
// or
BuilderUtils.Build<DemoPackageBuilder>("PackageContents.xml", builder => {...});
// or
BuilderUtils.Build<DemoPackageBuilder>(builder => {...}, "PackageContents.xml");
// or
BuilderUtils.Build<DemoPackageBuilder>(builder => {...}).Build("PackageContents.xml");
Create RevitAddin.addin
To get the RevitAddin.addin
like this:
<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Application">
<Name>RevitAddin</Name>
<AddInId>11111111-2222-3333-4444-555555555555</AddInId>
<Assembly>RevitAddin.dll</Assembly>
<FullClassName>RevitAddin.App</FullClassName>
<VendorId>RevitAddin</VendorId>
<VendorDescription>RevitAddin</VendorDescription>
</AddIn>
</RevitAddIns>
Inherit your builder class from RevitAddInsBuilder
base class.
public class DemoAddinBuilder : RevitAddInsBuilder
{
public DemoAddinBuilder()
{
AddIn.CreateEntry("Application")
.Name("RevitAddin")
.AddInId("11111111-2222-3333-4444-555555555555")
.Assembly("RevitAddin.dll")
.FullClassName("RevitAddin.App")
.VendorId("RevitAddin")
.VendorDescription("RevitAddin");
}
}
Or use BuilderUtils.Build<RevitAddInsBuilder>()
.
var builder = BuilderUtils.Build<RevitAddInsBuilder>(builder =>
{
builder.AddIn.CreateEntry("Application")
.Name("RevitAddin")
.AddInId("11111111-2222-3333-4444-555555555555")
.Assembly("RevitAddin.dll")
.FullClassName("RevitAddin.App")
.VendorId("RevitAddin")
.VendorDescription("RevitAddin");
});
Getting results
String result
var builder = new DemoAddinBuilder();
var result = builder.ToString();
.addin file
var builder = new DemoAddinBuilder();
builder.Build("RevitAddin.addin");
// or
BuilderUtils.Build<DemoAddinBuilder>("RevitAddin.addin");
// or
BuilderUtils.Build<DemoAddinBuilder>("RevitAddin.addin", builder => {...});
// or
BuilderUtils.Build<DemoAddinBuilder>(builder => {...}, "RevitAddin.addin");
// or
BuilderUtils.Build<DemoAddinBuilder>(builder => {...}).Build("RevitAddin.addin");
Package Inspiration / Reference
This package was inspared by InnoSetup.ScriptBuilder package.
License
This package is licensed under the MIT Licence.
Do you like this package? Please star this project on GitHub!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Autodesk.PackageBuilder:
Package | Downloads |
---|---|
ricaun.Nuke.PackageBuilder
Nuke PackageBuilder for Autodesk Application. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Autodesk.PackageBuilder:
Repository | Stars |
---|---|
Nice3point/RevitTemplates
Templates for creating Revit add-ins
|