Skip to content

Commit 9e11f55

Browse files
authored
Merge pull request #16 from ricaun-io/develop
Version 1.1.1
2 parents 552d939 + d785cb3 commit 9e11f55

File tree

9 files changed

+58
-27
lines changed

9 files changed

+58
-27
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.1.1] / 2024-02-27
8+
### Features
9+
- Support [Autodesk.Icon](https://github.com/ricaun-io/Autodesk.Icon.Example) in dark theme.
10+
### Updated
11+
- Add `AutodeskIconGeneratorUtils`.
12+
- Window close with `Esc` key.
13+
714
## [1.1.0] / 2024-02-17
815
### Features
916
- Support net core plugin.
@@ -59,6 +66,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5966
- [x] AutoUpdater
6067

6168
[vNext]: ../../compare/1.0.0...HEAD
69+
[1.1.1]: ../../compare/1.1.0...1.1.1
6270
[1.1.0]: ../../compare/1.0.6...1.1.0
6371
[1.0.6]: ../../compare/1.0.5...1.0.6
6472
[1.0.5]: ../../compare/1.0.4...1.0.5

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Just copy the `gist` link in the `RevitAddin.CommandLoader` compiler and execute
8282

8383
* [CommandVersion](https://gist.github.com/ricaun/200a576c3baa45cba034ceedac1e708e) - File with Revit defines.
8484
* [CommandCreate](https://gist.github.com/ricaun/4f62b8650d29f1ff837e7e77f9e8b552) - Multiple file each with a `IExternalCommand`.
85+
* [CommandTheme](https://gist.github.com/ricaun/86334ff6560e3e8c4671148c5c995b39) - Commands to change `UITheme`.
8586

8687
## Resources
8788

@@ -100,9 +101,9 @@ Videos in Portuguese with the creation of this project.
100101

101102
[![VideoIma1]][Video1]
102103

103-
Live videos in English about this project.
104+
Videos in English about this project.
104105

105-
[![VideoIma2]][Video2] [![VideoIma3]][Video3]
106+
[![VideoIma2]][Video2] [![VideoIma3]][Video3] [![VideoIma4]][Video4]
106107

107108
## License
108109

@@ -119,4 +120,5 @@ Do you like this project? Please [star this project on GitHub](../../stargazers)
119120
[VideoIma2]: https://img.youtube.com/vi/hI21lxm4EVU/mqdefault.jpg
120121
[Video3]: https://youtu.be/cOu7vjZnyXc
121122
[VideoIma3]: https://img.youtube.com/vi/cOu7vjZnyXc/mqdefault.jpg
122-
123+
[Video4]: https://youtu.be/y2GkFXoFwow
124+
[VideoIma4]: https://img.youtube.com/vi/y2GkFXoFwow/mqdefault.jpg
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using Autodesk.Revit.UI;
2+
using System;
3+
4+
namespace RevitAddin.CommandLoader.Extensions
5+
{
6+
public static class AutodeskIconGeneratorUtils
7+
{
8+
private static string[] icons = new[] { "Grey", "Red", "Yellow", "Green", "Cyan", "Blue", "Purple", "Pink", "Brown" };
9+
private static string[] types = new[] { "Box", "Cube" };
10+
private static string[] themes = new[] { "", "Dark" };
11+
private static char separetor = '-';
12+
private static string extension = ".ico";
13+
private static string url = "https://github.com/ricaun-io/Autodesk.Icon.Example/releases/download/1.0.0/";
14+
15+
private static int icon = 0;
16+
public static bool IsDark => UIThemeManager.CurrentTheme == UITheme.Dark;
17+
public static string GetBox()
18+
{
19+
return url + CreateIcon(icon++, 0, IsDark ? 1 : 0);
20+
}
21+
22+
public static string GetCube()
23+
{
24+
return url + CreateIcon(icon++, 1, IsDark ? 1 : 0);
25+
}
26+
27+
private static string CreateIcon(int icon = 0, int type = 0, int theme = 0)
28+
{
29+
var typeStr = types[type % types.Length];
30+
var iconStr = icons[icon % icons.Length];
31+
var themeStr = themes[theme % themes.Length];
32+
33+
var name = $"{typeStr}{separetor}{iconStr}";
34+
if (string.IsNullOrEmpty(themeStr) == false)
35+
name += $"{separetor}{themeStr}";
36+
37+
return $"{name}{extension}";
38+
}
39+
}
40+
}

RevitAddin.CommandLoader/Extensions/ImageGeneratorUtils.cs

Lines changed: 0 additions & 21 deletions
This file was deleted.

RevitAddin.CommandLoader/Revit/App.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static void CreateCommands(Assembly assembly)
109109

110110
if (needImage)
111111
{
112-
button.SetLargeImage(ImageGeneratorUtils.GetLargeImageUri());
112+
button.SetLargeImage(AutodeskIconGeneratorUtils.GetCube());
113113
}
114114
}
115115
}

RevitAddin.CommandLoader/Revit/CodeSamples.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace RevitAddin.CommandLoader.Revit
66
{
77
public class CodeSamples
88
{
9+
public static string CommandThemeGist => "https://gist.github.com/ricaun/86334ff6560e3e8c4671148c5c995b39";
910
public static string CommandVersionGist => "https://gist.github.com/ricaun/200a576c3baa45cba034ceedac1e708e";
1011
public static string Command =>
1112
@"using System;

RevitAddin.CommandLoader/RevitAddin.CommandLoader.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108

109109
<PropertyGroup>
110110
<PackageId>RevitAddin.CommandLoader</PackageId>
111-
<Version>1.1.0</Version>
111+
<Version>1.1.1</Version>
112112
<ProjectGuid>{82070359-36DA-4441-A59D-9018B6A8B348}</ProjectGuid>
113113
</PropertyGroup>
114114

RevitAddin.CommandLoader/ViewModels/CompileViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class CompileViewModel : ObservableObject
2121
#region Public Properties
2222
public string Text { get; set; } =
2323
#if DEBUG
24-
CodeSamples.CommandVersionGist;
24+
CodeSamples.CommandThemeGist;
2525
#else
2626
CodeSamples.Command;
2727
#endif

RevitAddin.CommandLoader/Views/CompileView.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public CompileView()
99
{
1010
InitializeComponent();
1111
InitializeWindow();
12+
this.KeyDown += (s, e) => { if (e.Key == System.Windows.Input.Key.Escape) { this.Close(); } };
1213
}
1314

1415
#region InitializeWindow

0 commit comments

Comments
 (0)