Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Develop to Oss.da #4

Merged
merged 53 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3dc49eb
Add DesignAutomationConsole
ricaun Jan 5, 2023
f96e64a
Fix CreateAppBundleAsync
ricaun Jan 5, 2023
1696764
Add PageUtils
ricaun Jan 5, 2023
efaa4c3
Update summary
ricaun Jan 5, 2023
f4a3c5b
Add default Forge Configuration
ricaun Jan 9, 2023
b79ef0c
Misspell DBApplication
ricaun Jan 9, 2023
c9fa650
Using Preview LangVersion
ricaun Jan 9, 2023
d6d9e58
Add OSS in the DesignAutomationService
ricaun Jan 9, 2023
eb2b1bc
`GetBundleAsync` test method
ricaun Jan 10, 2023
4b1f7e2
Multiple version engine
ricaun Jan 10, 2023
fc8099a
new RevitDesignAutomationService
ricaun Jan 12, 2023
19f9fab
Update `IArgumentUtils`
ricaun Feb 17, 2023
81a64c1
Add CreateWorkItem to test
ricaun Feb 17, 2023
56c31fa
###Features
ricaun Feb 17, 2023
e9bf6ff
Test Alternative Options
ricaun Apr 12, 2023
e3e0a26
Add ConvertUpperToUnderscore
ricaun Apr 12, 2023
f1561bb
Update ParameterArgumentService
ricaun Apr 12, 2023
d26c1da
Update ParameterArgumentService
ricaun Apr 12, 2023
9eecb5f
Update GetNicknameAsync
ricaun Apr 13, 2023
d83268c
Add JsonExtension/JsonService
ricaun Apr 13, 2023
b26420b
Update Run
ricaun Apr 13, 2023
764ac53
Add ParameterOptionsFile
ricaun Apr 13, 2023
4481167
Update Engine and WorkItemStatusWait
ricaun Apr 13, 2023
955f05b
Update Extension DA
ricaun Apr 13, 2023
77c8025
Add Bundle
ricaun Apr 18, 2023
f349a16
Update DA
ricaun May 3, 2023
27fa5d3
Update
ricaun May 9, 2023
06b41ea
Add ParameterActivity
ricaun May 9, 2023
e9d587e
Update ParameterOptions
ricaun May 9, 2023
b952d55
Add ParameterActivity Attributes
ricaun May 9, 2023
5bbd266
Update Attribute ClearBundle
ricaun May 16, 2023
01edf60
Clear DesignAutomationService
ricaun May 17, 2023
82c4354
Clear DesignAutomationService
ricaun May 17, 2023
2da2d9e
Update Attributes
ricaun May 17, 2023
2ce4708
Update DA
ricaun May 17, 2023
9fbed1a
Update ParameterArgumentService
ricaun May 17, 2023
d56b7d6
Update Console
ricaun May 17, 2023
ef13aa2
Add ParameterWorkItemTimeSec
ricaun May 17, 2023
9f4218c
Add Hash in ParameterArgumentService upload/download
ricaun May 18, 2023
43c8cd0
Clear Program
ricaun May 18, 2023
a075ec2
Change name of downloadFileName
ricaun May 18, 2023
6d3656a
Result
ricaun May 18, 2023
e75697b
Update
ricaun May 23, 2023
13897b1
Update
ricaun May 23, 2023
98ed365
Update Program
ricaun May 23, 2023
d7ccc41
Create ricaun.Forge.DesignAutomation
ricaun May 23, 2023
5115481
Clear Test Model
ricaun May 23, 2023
f6f6a86
Update Documentation
ricaun May 23, 2023
b004e50
Using `ricaun.Autodesk.Forge.Oss.DesignAutomation`
ricaun May 30, 2023
ee2dd8c
Update Program
ricaun May 30, 2023
6978d1a
Add `UI.Valid` class to check if Revit UI is available.
ricaun Feb 15, 2024
0bd2b9c
Add DesignAutomationReadyEvent only
ricaun Feb 27, 2024
7ddf092
Merge branch 'develop' into oss.da
ricaun Feb 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Build/.nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Build Schema",
"$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": {
"build": {
"type": "object",
Expand Down Expand Up @@ -51,6 +51,9 @@
"MainName": {
"type": "string"
},
"MiddleVersions": {
"type": "boolean"
},
"Name": {
"type": "string"
},
Expand Down Expand Up @@ -79,12 +82,18 @@
"ProjectNameFolder": {
"type": "boolean"
},
"ProjectRemoveTargetFrameworkFolder": {
"type": "boolean"
},
"ProjectVersionFolder": {
"type": "boolean"
},
"ReleaseBundle": {
"type": "boolean"
},
"ReleaseFolder": {
"type": "string"
},
"ReleaseNameVersion": {
"type": "boolean"
},
Expand Down Expand Up @@ -158,4 +167,4 @@
}
}
}
}
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.1.0] / 2024-02-15
- Add `UI.Valid` class to check if Revit UI is available.

## [1.0.1] / 2023-01-09
### Fixed
- Fix `DBApplication` misspell
Expand All @@ -12,5 +15,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- First Release

[vNext]: ../../compare/1.0.0...HEAD
[1.1.0]: ../../compare/1.0.0...1.1.0
[1.0.1]: ../../compare/1.0.0...1.0.1
[1.0.0]: ../../compare/1.0.0
Binary file not shown.
Binary file not shown.
52 changes: 52 additions & 0 deletions DesignAutomationConsole/DesignAutomationConsole.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ricaun.Autodesk.Forge.Oss.DesignAutomation" Version="*" />
</ItemGroup>
<!--
<ItemGroup>
<PackageReference Include="ricaun.Autodesk.Forge.Oss" Version="*" />
<PackageReference Include="Autodesk.Forge.DesignAutomation" Version="*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ricaun.Forge.DesignAutomation\ricaun.Forge.DesignAutomation.csproj" />
</ItemGroup>
-->

<ItemGroup>
<None Update="Bundle\RevitAddin.DA.Tester.bundle.zip">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Bundle\RevitAddin.DA.Tester.DB.bundle.zip">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Bundle\RevitAddin.DA.Tester.UI.bundle.zip">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<!-- Fody -->
<ItemGroup>
<PackageReference Include="Costura.Fody" Version="5.*" IncludeAssets="build; compile" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup>
<WeaverConfiguration>
<Weavers>
<Costura CreateTemporaryAssemblies="true" />
</Weavers>
</WeaverConfiguration>
<WeaverConfiguration Condition="$(Configuration.Contains('Debug'))">
<Weavers>
<Costura IncludeAssemblies="" />
<Costura CreateTemporaryAssemblies="true" />
</Weavers>
</WeaverConfiguration>
</PropertyGroup>

</Project>
14 changes: 14 additions & 0 deletions DesignAutomationConsole/Models/InputModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Autodesk.Forge.Oss.DesignAutomation.Extensions;

namespace DesignAutomationConsole.Models
{
public class InputModel
{
public string Text { get; set; }

public override string ToString()
{
return this.ToJson();
}
}
}
12 changes: 12 additions & 0 deletions DesignAutomationConsole/Models/OutputModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace DesignAutomationConsole.Models
{
public class OutputModel
{
public string VersionName { get; set; }
public string VersionBuild { get; set; }
public DateTime TimeStart { get; set; } = DateTime.UtcNow;
public string Text { get; set; }
}
}
45 changes: 45 additions & 0 deletions DesignAutomationConsole/Models/ParameterOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Autodesk.Forge.Oss.DesignAutomation.Attributes;

namespace DesignAutomationConsole.Models
{
public class ParameterOptions
{
[ParameterInput("input.json",
Description = "Input file.",
Required = true)]
public InputModel Input { get; set; } = new InputModel();

[ParameterOutput("output.json",
Description = "Output file.")]
public OutputModel Output { get; set; }

//[ParameterWorkItemTimeSec]
//public int TimeSec { get; set; } = 60;

//public string Engine { get; set; }
//[ParameterActivityLanguage]
//public string Language { get; set; } = "DEU";
}

public class ParameterOptionsDownload
{
[ParameterInput("input.json",
Required = true)]
public InputModel Input { get; set; }

[ParameterOutput("output.json", DownloadFile = true)]
public string Output { get; set; }
}

public class ParameterOptionsFile
{
[ParameterInput("input.json",
Description = "Input file.",
Required = true)]
public string Input { get; set; }

[ParameterOutput("output.json",
Description = "Output file.")]
public OutputModel Output { get; set; }
}
}
80 changes: 80 additions & 0 deletions DesignAutomationConsole/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
using Autodesk.Forge.DesignAutomation.Model;
using Autodesk.Forge.Oss.DesignAutomation;
using Autodesk.Forge.Oss.DesignAutomation.Extensions;
using Autodesk.Forge.Oss.DesignAutomation.Services;
using DesignAutomationConsole.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace DesignAutomationConsole
{
public class Program
{
public static async Task Main(string[] args)
{
Console.WriteLine("...");

//var ForgeConfiguration = new ForgeConfiguration()
//{
// ClientId = Environment.GetEnvironmentVariable("FORGE_RICAUN_CLIENT_ID"),
// ClientSecret = Environment.GetEnvironmentVariable("FORGE_RICAUN_CLIENT_SECRET")
//};

await DA_RevitAddin_DA_Tester();
}

private static async Task DA_RevitAddin_DA_Tester()
{
const string RequestUri =
"https://github.com/ricaun-io/RevitAddin.DA.Tester/releases/latest/download/RevitAddin.DA.Tester.bundle.zip";

var appName = "RevitAddin_DA_Tester";

IDesignAutomationService designAutomationService = new RevitDesignAutomationService(appName)
{
EngineVersions = new[] {
//"2019",
//"2020",
"2021",
//"2022",
//"2023",
//"2024",
},
EnableConsoleLogger = true,
//EnableParameterConsoleLogger = true,
EnableReportConsoleLogger = true,
};

//Console.WriteLine($"Nickname: {designAutomationService.GetNickname()}");
//await designAutomationService.Initialize($".\\Bundle\\RevitAddin.DA.Tester.DB.bundle.zip");
await designAutomationService.Initialize($".\\Bundle\\RevitAddin.DA.Tester.bundle.zip");

//await designAutomationService.Initialize(await RequestService.Instance.GetFileAsync(RequestUri));

var engineVersions = designAutomationService.CoreEngineVersions();

var options = new List<ParameterOptions>();
var tasks = new List<Task>();
foreach (var engineVersion in engineVersions)
{
var option = new ParameterOptions()
{
Input = new InputModel() { Text = engineVersion }
};
options.Add(option);
var daTask = designAutomationService.Run<ParameterOptions>(option, engineVersion);
tasks.Add(daTask);
}

await Task.WhenAll(tasks);

foreach (var option in options)
{
Console.WriteLine(option.ToJson());
}

await designAutomationService.Delete();
}
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RevitAddin.DA.Tester

[![Revit +2018](https://img.shields.io/badge/Revit-2018+-blue.svg)](../..)
[![Revit +2019](https://img.shields.io/badge/Revit-2019+-blue.svg)](../..)
[![Visual Studio 2022](https://img.shields.io/badge/Visual%20Studio-2022-blue)](../..)
[![Nuke](https://img.shields.io/badge/Nuke-Build-blue)](https://nuke.build/)
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
Expand Down
17 changes: 13 additions & 4 deletions RevitAddin.DA.Tester.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
# Visual Studio Version 17
VisualStudioVersion = 17.2.32630.192
MinimumVisualStudioVersion = 10.0.40219.1
Project("{CEE7DFBF-1830-47FB-8DB8-546D2C2079D0}") = "RevitAddin.DA.Tester", "RevitAddin.DA.Tester\RevitAddin.DA.Tester.csproj", "{7C324916-9F8D-43B0-B226-DA67D2504393}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RevitAddin.DA.Tester", "RevitAddin.DA.Tester\RevitAddin.DA.Tester.csproj", "{7C324916-9F8D-43B0-B226-DA67D2504393}"
EndProject
Project("{CEE7DFBF-1830-47FB-8DB8-546D2C2079D0}") = "Build", "Build\Build.csproj", "{99BC4B5A-3BB9-464B-AA8E-4A377FB77D04}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "Build\Build.csproj", "{99BC4B5A-3BB9-464B-AA8E-4A377FB77D04}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{64A2F0FA-4270-45D5-B9DB-3561832ADA42}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -14,6 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{64
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DesignAutomationConsole", "DesignAutomationConsole\DesignAutomationConsole.csproj", "{7F41BE81-4EFB-4FAC-8563-B5EDAEA9F44B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -26,8 +28,15 @@ Global
{7C324916-9F8D-43B0-B226-DA67D2504393}.Release|Any CPU.Build.0 = Release|Any CPU
{99BC4B5A-3BB9-464B-AA8E-4A377FB77D04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99BC4B5A-3BB9-464B-AA8E-4A377FB77D04}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F41BE81-4EFB-4FAC-8563-B5EDAEA9F44B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F41BE81-4EFB-4FAC-8563-B5EDAEA9F44B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F41BE81-4EFB-4FAC-8563-B5EDAEA9F44B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F41BE81-4EFB-4FAC-8563-B5EDAEA9F44B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A62BD73A-4469-4188-B25B-3958364DC778}
EndGlobalSection
EndGlobal
2 changes: 2 additions & 0 deletions RevitAddin.DA.Tester/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public ExternalDBApplicationResult OnShutdown(ControlledApplication application)

private void DesignAutomationBridge_DesignAutomationReadyEvent(object sender, DesignAutomationReadyEventArgs e)
{
DesignAutomationBridge.DesignAutomationReadyEvent -= DesignAutomationBridge_DesignAutomationReadyEvent;

var data = e.DesignAutomationData;
e.Succeeded = DesignAutomationController.Execute(data.RevitApp, data.FilePath, data.RevitDoc);
}
Expand Down
1 change: 1 addition & 0 deletions RevitAddin.DA.Tester/Revit/UI/AppUI.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using ricaun.Revit.UI;
using ricaun.Revit.UI.Drawing;
using System;

namespace RevitAddin.DA.Tester.Revit.UI
Expand Down
8 changes: 5 additions & 3 deletions RevitAddin.DA.Tester/RevitAddin.DA.Tester.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
Expand Down Expand Up @@ -91,7 +91,7 @@

<PropertyGroup>
<PackageId>RevitAddin.DA.Tester</PackageId>
<Version>1.0.1</Version>
<Version>1.1.0</Version>
<ProjectGuid>{7C324916-9F8D-43B0-B226-DA67D2504393}</ProjectGuid>
</PropertyGroup>

Expand Down Expand Up @@ -134,7 +134,9 @@

<ItemGroup>
<PackageReference Include="Autodesk.Forge.DesignAutomation.Revit" Version="$(RevitVersion).*" />
<PackageReference Include="Newtonsoft.Json" Version="9.*" IncludeAssets="build; compile" PrivateAssets="All" />
<PackageReference Include="Newtonsoft.Json" Version="9.*" IncludeAssets="build; compile" PrivateAssets="All">
<NoWarn>NU1903</NoWarn>
</PackageReference>
<PackageReference Include="Revit_All_Main_Versions_API_x64" Version="$(RevitVersion).*" IncludeAssets="build; compile" PrivateAssets="All" />
</ItemGroup>

Expand Down
21 changes: 21 additions & 0 deletions RevitAddin.DA.Tester/Services/CommandUI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System;

namespace RevitAddin.DA.Tester.Services
{
[Transaction(TransactionMode.Manual)]
public class CommandUI : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elementSet)
{
UIApplication uiapp = commandData.Application;

Console.WriteLine($"UI: {UI.IsValid()}");

return Result.Succeeded;
}
}

}
3 changes: 3 additions & 0 deletions RevitAddin.DA.Tester/Services/DesignAutomationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public static bool Execute(Application application, string filePath = null, Docu
Console.WriteLine($"Output:\t{outputModel}");
Console.WriteLine("----------------------------------------");

Console.WriteLine($"UI: {UI.IsValid()}");
Console.WriteLine("----------------------------------------");

return true;
}
}
Expand Down
Loading