Skip to content

Commit

Permalink
Merge pull request #2 from ricaun-io/develop
Browse files Browse the repository at this point in the history
Version 1.1.0
  • Loading branch information
ricaun authored Nov 20, 2024
2 parents 5d9d94c + 681c6dc commit 7237380
Show file tree
Hide file tree
Showing 77 changed files with 125 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Build/Build.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>.</NukeRootDirectory>
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@ 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-11-14
- Update `ricaun.Revit.UI` to `0.7.1`
- Add missing `Orange` color
- Obsolete `RibbonImageThemeSelector` to use `ricaun.Revit.UI`.
- Rename Images to have `Light` in the name to enable the theme change to `Dark`.
- Add `Box` image files as resources.
- Use `tiff` files to enable high-quality icon.

## [1.0.1] / 2024-01-11
- Add Revit version 2025 configuration

## [1.0.0] / 2024-01-11
- First Release

[vNext]: ../../compare/1.0.0...HEAD
[1.1.0]: ../../compare/1.0.1...1.1.0
[1.0.1]: ../../compare/1.0.0...1.0.1
[1.0.0]: ../../compare/1.0.0
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# RevitAddin.Icon.Example

Example to swap the icons when theme change in Revit 2024 using the [Autodesk.Icon.Example](https://github.com/ricaun-io/Autodesk.Icon.Example) icons.

[![Revit 2024](https://img.shields.io/badge/Revit-2024+-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)
[![Build](../../actions/workflows/Build.yml/badge.svg)](../../actions)

Example to swap the icons when theme change in Revit 2024/2025 using the [Autodesk.Icon.Example](https://github.com/ricaun-io/Autodesk.Icon.Example) icons.

This project uses the [ricaun.Revit.UI](https://www.nuget.org/packages/ricaun.Revit.UI) library to handle the theme change and the selection of the icons in [high resolution](#high-resolution-icons) when a `.tiff` file is used.

![Images-2x](assets/Images-2x.gif)

This project was generated by the [ricaun.AppLoader](https://ricaun.com/AppLoader/) Revit plugin.

## Installation
Expand All @@ -16,14 +20,18 @@ This project was generated by the [ricaun.AppLoader](https://ricaun.com/AppLoade

## Video

Video in english with the creation of this project.
Video in English with the creation of this project.

[![VideoIma1]][Video1]
[![VideoIma2]][Video2]

### High resolution icons for Revit {#high-resolution-icons}

[![VideoIma3]][Video3]

## License

This project is [licensed](LICENSE) under the [MIT Licence](https://en.wikipedia.org/wiki/MIT_License).
This project is [licensed](LICENSE) under the [MIT License](https://en.wikipedia.org/wiki/MIT_License).

---

Expand All @@ -33,4 +41,6 @@ Do you like this project? Please [star this project on GitHub](../../stargazers)
[VideoIma1]: https://img.youtube.com/vi/Ggtz4-pVVYw/mqdefault.jpg
[Video2]: https://youtu.be/q14EKVZaeqE
[VideoIma2]: https://img.youtube.com/vi/q14EKVZaeqE/mqdefault.jpg
[Video3]: https://youtu.be/q__JuQDTH_k
[VideoIma3]: https://img.youtube.com/vi/q__JuQDTH_k/mqdefault.jpg

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
36 changes: 28 additions & 8 deletions RevitAddin.Icon.Example/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,58 @@
using Autodesk.Revit.UI;
using ricaun.Revit.UI;
using System.IO;
using System.Linq;

namespace RevitAddin.Icon.Example.Revit
{
[AppLoader]
public class App : IExternalApplication
{
private static RibbonPanel ribbonPanel;
private static RibbonImageThemeSelector ribbonImageThemeSelector;
public Result OnStartup(UIControlledApplication application)
{
ribbonImageThemeSelector = new RibbonImageThemeSelector(application);

var icons = new[] { "Grey", "Red", "Yellow", "Green", "Cyan", "Blue", "Purple", "Pink", "Brown" };
var icons = new[] { "Grey", "Red", "Orange", "Yellow", "Green", "Cyan", "Blue", "Purple", "Pink", "Brown" };

ribbonPanel = application.CreatePanel("RevitAddin.Icon.Example");

foreach (var icon in icons)
{
ribbonPanel.CreatePushButton<Commands.Command>(icon)
.SetLargeImage($"Resources/Images/Cube-{icon}.ico");
.SetLargeImage($"Resources/Images/Cube-{icon}-Light.tiff");
}

ribbonImageThemeSelector.AddRibbonItem(ribbonPanel.GetRibbonItems());
ribbonPanel.AddSlideOut();

ribbonImageThemeSelector.UpdateImages();
foreach (var icon in icons)
{
ribbonPanel.RowLargeStackedItems(
ribbonPanel.CreatePushButton<Commands.Command>(icon)
.SetLargeImage($"Resources/Images/Cube-{icon}-Light.tiff")
.SetShowText(),
ribbonPanel.CreatePushButton<Commands.Command>(icon)
.SetLargeImage($"Resources/Images/Box-{icon}-Light.tiff")
.SetShowText()
);
}

foreach (var icon in icons)
{
ribbonPanel.RowStackedItems(
ribbonPanel.CreatePushButton<Commands.Command>(icon)
.SetLargeImage($"Resources/Images/Cube-{icon}-Light.tiff")
.SetShowText(),
ribbonPanel.CreatePushButton<Commands.Command>(icon)
.SetLargeImage($"Resources/Images/Box-{icon}-Light.tiff")
.SetShowText()
);
}

return Result.Succeeded;
}

public Result OnShutdown(UIControlledApplication application)
{
ribbonPanel?.Remove();
ribbonImageThemeSelector?.Dispose();
return Result.Succeeded;
}
}
Expand Down
1 change: 1 addition & 0 deletions RevitAddin.Icon.Example/Revit/RibbonImageThemeSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace RevitAddin.Icon.Example.Revit
{
[Obsolete("ricaun.Revit.UI have the same feature by default if the name of image have `light` and `dark`")]
public class RibbonImageThemeSelector : IDisposable
{
private readonly UIControlledApplication application;
Expand Down
107 changes: 72 additions & 35 deletions RevitAddin.Icon.Example/RevitAddin.Icon.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<When Condition="$(Configuration.Contains('2025'))">
<PropertyGroup>
<RevitVersion>2025</RevitVersion>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
</PropertyGroup>
</When>
<Otherwise>
Expand Down Expand Up @@ -108,7 +108,7 @@

<PropertyGroup>
<PackageId>RevitAddin.Icon.Example</PackageId>
<Version>1.0.1</Version>
<Version>1.1.0</Version>
<ProjectGuid>{A206D7F5-A69C-4011-BD5B-9E419B5DE41E}</ProjectGuid>
</PropertyGroup>

Expand All @@ -134,29 +134,6 @@
<Copyright>Copyright © $(CopyrightYears) $(Company)</Copyright>
</PropertyGroup>

<ItemGroup>
<None Remove="Resources\Images\Cube-Blue-Dark.ico" />
<None Remove="Resources\Images\Cube-Blue.ico" />
<None Remove="Resources\Images\Cube-Brown-Dark.ico" />
<None Remove="Resources\Images\Cube-Brown.ico" />
<None Remove="Resources\Images\Cube-Cyan-Dark.ico" />
<None Remove="Resources\Images\Cube-Cyan.ico" />
<None Remove="Resources\Images\Cube-Green-Dark.ico" />
<None Remove="Resources\Images\Cube-Green.ico" />
<None Remove="Resources\Images\Cube-Grey-Dark.ico" />
<None Remove="Resources\Images\Cube-Grey.ico" />
<None Remove="Resources\Images\Cube-Orange-Dark.ico" />
<None Remove="Resources\Images\Cube-Orange.ico" />
<None Remove="Resources\Images\Cube-Pink-Dark.ico" />
<None Remove="Resources\Images\Cube-Pink.ico" />
<None Remove="Resources\Images\Cube-Purple-Dark.ico" />
<None Remove="Resources\Images\Cube-Purple.ico" />
<None Remove="Resources\Images\Cube-Red-Dark.ico" />
<None Remove="Resources\Images\Cube-Red.ico" />
<None Remove="Resources\Images\Cube-Yellow-Dark.ico" />
<None Remove="Resources\Images\Cube-Yellow.ico" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="ricaun.Revit.UI" Version="*" />
<PackageReference Include="ricaun.Revit.Mvvm" Version="*" />
Expand All @@ -168,26 +145,86 @@
</ItemGroup>

<ItemGroup>
<Resource Include="Resources\Images\Box-Blue-Dark.ico" />
<Resource Include="Resources\Images\Box-Blue-Dark.tiff" />
<Resource Include="Resources\Images\Box-Blue-Light.ico" />
<Resource Include="Resources\Images\Box-Blue-Light.tiff" />
<Resource Include="Resources\Images\Box-Brown-Dark.ico" />
<Resource Include="Resources\Images\Box-Brown-Dark.tiff" />
<Resource Include="Resources\Images\Box-Brown-Light.ico" />
<Resource Include="Resources\Images\Box-Brown-Light.tiff" />
<Resource Include="Resources\Images\Box-Cyan-Dark.ico" />
<Resource Include="Resources\Images\Box-Cyan-Dark.tiff" />
<Resource Include="Resources\Images\Box-Cyan-Light.ico" />
<Resource Include="Resources\Images\Box-Cyan-Light.tiff" />
<Resource Include="Resources\Images\Box-Green-Dark.ico" />
<Resource Include="Resources\Images\Box-Green-Dark.tiff" />
<Resource Include="Resources\Images\Box-Green-Light.ico" />
<Resource Include="Resources\Images\Box-Green-Light.tiff" />
<Resource Include="Resources\Images\Box-Grey-Dark.ico" />
<Resource Include="Resources\Images\Box-Grey-Dark.tiff" />
<Resource Include="Resources\Images\Box-Grey-Light.ico" />
<Resource Include="Resources\Images\Box-Grey-Light.tiff" />
<Resource Include="Resources\Images\Box-Orange-Dark.ico" />
<Resource Include="Resources\Images\Box-Orange-Dark.tiff" />
<Resource Include="Resources\Images\Box-Orange-Light.ico" />
<Resource Include="Resources\Images\Box-Orange-Light.tiff" />
<Resource Include="Resources\Images\Box-Pink-Dark.ico" />
<Resource Include="Resources\Images\Box-Pink-Dark.tiff" />
<Resource Include="Resources\Images\Box-Pink-Light.ico" />
<Resource Include="Resources\Images\Box-Pink-Light.tiff" />
<Resource Include="Resources\Images\Box-Purple-Dark.ico" />
<Resource Include="Resources\Images\Box-Purple-Dark.tiff" />
<Resource Include="Resources\Images\Box-Purple-Light.ico" />
<Resource Include="Resources\Images\Box-Purple-Light.tiff" />
<Resource Include="Resources\Images\Box-Red-Dark.ico" />
<Resource Include="Resources\Images\Box-Red-Dark.tiff" />
<Resource Include="Resources\Images\Box-Red-Light.ico" />
<Resource Include="Resources\Images\Box-Red-Light.tiff" />
<Resource Include="Resources\Images\Box-Yellow-Dark.ico" />
<Resource Include="Resources\Images\Box-Yellow-Dark.tiff" />
<Resource Include="Resources\Images\Box-Yellow-Light.ico" />
<Resource Include="Resources\Images\Box-Yellow-Light.tiff" />
<Resource Include="Resources\Images\Cube-Blue-Dark.ico" />
<Resource Include="Resources\Images\Cube-Blue.ico" />
<Resource Include="Resources\Images\Cube-Blue-Dark.tiff" />
<Resource Include="Resources\Images\Cube-Blue-Light.ico" />
<Resource Include="Resources\Images\Cube-Blue-Light.tiff" />
<Resource Include="Resources\Images\Cube-Brown-Dark.ico" />
<Resource Include="Resources\Images\Cube-Brown.ico" />
<Resource Include="Resources\Images\Cube-Brown-Dark.tiff" />
<Resource Include="Resources\Images\Cube-Brown-Light.ico" />
<Resource Include="Resources\Images\Cube-Brown-Light.tiff" />
<Resource Include="Resources\Images\Cube-Cyan-Dark.ico" />
<Resource Include="Resources\Images\Cube-Cyan.ico" />
<Resource Include="Resources\Images\Cube-Cyan-Dark.tiff" />
<Resource Include="Resources\Images\Cube-Cyan-Light.ico" />
<Resource Include="Resources\Images\Cube-Cyan-Light.tiff" />
<Resource Include="Resources\Images\Cube-Green-Dark.ico" />
<Resource Include="Resources\Images\Cube-Green.ico" />
<Resource Include="Resources\Images\Cube-Green-Dark.tiff" />
<Resource Include="Resources\Images\Cube-Green-Light.ico" />
<Resource Include="Resources\Images\Cube-Green-Light.tiff" />
<Resource Include="Resources\Images\Cube-Grey-Dark.ico" />
<Resource Include="Resources\Images\Cube-Grey.ico" />
<Resource Include="Resources\Images\Cube-Grey-Dark.tiff" />
<Resource Include="Resources\Images\Cube-Grey-Light.ico" />
<Resource Include="Resources\Images\Cube-Grey-Light.tiff" />
<Resource Include="Resources\Images\Cube-Orange-Dark.ico" />
<Resource Include="Resources\Images\Cube-Orange.ico" />
<Resource Include="Resources\Images\Cube-Orange-Dark.tiff" />
<Resource Include="Resources\Images\Cube-Orange-Light.ico" />
<Resource Include="Resources\Images\Cube-Orange-Light.tiff" />
<Resource Include="Resources\Images\Cube-Pink-Dark.ico" />
<Resource Include="Resources\Images\Cube-Pink.ico" />
<Resource Include="Resources\Images\Cube-Pink-Dark.tiff" />
<Resource Include="Resources\Images\Cube-Pink-Light.ico" />
<Resource Include="Resources\Images\Cube-Pink-Light.tiff" />
<Resource Include="Resources\Images\Cube-Purple-Dark.ico" />
<Resource Include="Resources\Images\Cube-Purple.ico" />
<Resource Include="Resources\Images\Cube-Purple-Dark.tiff" />
<Resource Include="Resources\Images\Cube-Purple-Light.ico" />
<Resource Include="Resources\Images\Cube-Purple-Light.tiff" />
<Resource Include="Resources\Images\Cube-Red-Dark.ico" />
<Resource Include="Resources\Images\Cube-Red.ico" />
<Resource Include="Resources\Images\Cube-Red-Dark.tiff" />
<Resource Include="Resources\Images\Cube-Red-Light.ico" />
<Resource Include="Resources\Images\Cube-Red-Light.tiff" />
<Resource Include="Resources\Images\Cube-Yellow-Dark.ico" />
<Resource Include="Resources\Images\Cube-Yellow.ico" />
<Resource Include="Resources\Images\Cube-Yellow-Dark.tiff" />
<Resource Include="Resources\Images\Cube-Yellow-Light.ico" />
<Resource Include="Resources\Images\Cube-Yellow-Light.tiff" />
<Resource Include="Resources\Revit.ico" />
</ItemGroup>

Expand Down
Binary file added assets/Images-2x.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7237380

Please sign in to comment.