Skip to content

Commit

Permalink
Merge pull request #16 from ricaun-io/develop
Browse files Browse the repository at this point in the history
Version 1.1.1
  • Loading branch information
ricaun authored Feb 27, 2024
2 parents 552d939 + d785cb3 commit 9e11f55
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 27 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ 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.1] / 2024-02-27
### Features
- Support [Autodesk.Icon](https://github.com/ricaun-io/Autodesk.Icon.Example) in dark theme.
### Updated
- Add `AutodeskIconGeneratorUtils`.
- Window close with `Esc` key.

## [1.1.0] / 2024-02-17
### Features
- Support net core plugin.
Expand Down Expand Up @@ -59,6 +66,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [x] AutoUpdater

[vNext]: ../../compare/1.0.0...HEAD
[1.1.1]: ../../compare/1.1.0...1.1.1
[1.1.0]: ../../compare/1.0.6...1.1.0
[1.0.6]: ../../compare/1.0.5...1.0.6
[1.0.5]: ../../compare/1.0.4...1.0.5
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Just copy the `gist` link in the `RevitAddin.CommandLoader` compiler and execute

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

## Resources

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

[![VideoIma1]][Video1]

Live videos in English about this project.
Videos in English about this project.

[![VideoIma2]][Video2] [![VideoIma3]][Video3]
[![VideoIma2]][Video2] [![VideoIma3]][Video3] [![VideoIma4]][Video4]

## License

Expand All @@ -119,4 +120,5 @@ Do you like this project? Please [star this project on GitHub](../../stargazers)
[VideoIma2]: https://img.youtube.com/vi/hI21lxm4EVU/mqdefault.jpg
[Video3]: https://youtu.be/cOu7vjZnyXc
[VideoIma3]: https://img.youtube.com/vi/cOu7vjZnyXc/mqdefault.jpg

[Video4]: https://youtu.be/y2GkFXoFwow
[VideoIma4]: https://img.youtube.com/vi/y2GkFXoFwow/mqdefault.jpg
40 changes: 40 additions & 0 deletions RevitAddin.CommandLoader/Extensions/AutodeskIconGeneratorUtils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Autodesk.Revit.UI;
using System;

namespace RevitAddin.CommandLoader.Extensions
{
public static class AutodeskIconGeneratorUtils
{
private static string[] icons = new[] { "Grey", "Red", "Yellow", "Green", "Cyan", "Blue", "Purple", "Pink", "Brown" };
private static string[] types = new[] { "Box", "Cube" };
private static string[] themes = new[] { "", "Dark" };
private static char separetor = '-';
private static string extension = ".ico";
private static string url = "https://github.com/ricaun-io/Autodesk.Icon.Example/releases/download/1.0.0/";

private static int icon = 0;
public static bool IsDark => UIThemeManager.CurrentTheme == UITheme.Dark;
public static string GetBox()
{
return url + CreateIcon(icon++, 0, IsDark ? 1 : 0);
}

public static string GetCube()
{
return url + CreateIcon(icon++, 1, IsDark ? 1 : 0);
}

private static string CreateIcon(int icon = 0, int type = 0, int theme = 0)
{
var typeStr = types[type % types.Length];
var iconStr = icons[icon % icons.Length];
var themeStr = themes[theme % themes.Length];

var name = $"{typeStr}{separetor}{iconStr}";
if (string.IsNullOrEmpty(themeStr) == false)
name += $"{separetor}{themeStr}";

return $"{name}{extension}";
}
}
}
21 changes: 0 additions & 21 deletions RevitAddin.CommandLoader/Extensions/ImageGeneratorUtils.cs

This file was deleted.

2 changes: 1 addition & 1 deletion RevitAddin.CommandLoader/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static void CreateCommands(Assembly assembly)

if (needImage)
{
button.SetLargeImage(ImageGeneratorUtils.GetLargeImageUri());
button.SetLargeImage(AutodeskIconGeneratorUtils.GetCube());
}
}
}
Expand Down
1 change: 1 addition & 0 deletions RevitAddin.CommandLoader/Revit/CodeSamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace RevitAddin.CommandLoader.Revit
{
public class CodeSamples
{
public static string CommandThemeGist => "https://gist.github.com/ricaun/86334ff6560e3e8c4671148c5c995b39";
public static string CommandVersionGist => "https://gist.github.com/ricaun/200a576c3baa45cba034ceedac1e708e";
public static string Command =>
@"using System;
Expand Down
2 changes: 1 addition & 1 deletion RevitAddin.CommandLoader/RevitAddin.CommandLoader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

<PropertyGroup>
<PackageId>RevitAddin.CommandLoader</PackageId>
<Version>1.1.0</Version>
<Version>1.1.1</Version>
<ProjectGuid>{82070359-36DA-4441-A59D-9018B6A8B348}</ProjectGuid>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion RevitAddin.CommandLoader/ViewModels/CompileViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class CompileViewModel : ObservableObject
#region Public Properties
public string Text { get; set; } =
#if DEBUG
CodeSamples.CommandVersionGist;
CodeSamples.CommandThemeGist;
#else
CodeSamples.Command;
#endif
Expand Down
1 change: 1 addition & 0 deletions RevitAddin.CommandLoader/Views/CompileView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public CompileView()
{
InitializeComponent();
InitializeWindow();
this.KeyDown += (s, e) => { if (e.Key == System.Windows.Input.Key.Escape) { this.Close(); } };
}

#region InitializeWindow
Expand Down

0 comments on commit 9e11f55

Please sign in to comment.