Is there a way to specify an icon for light theme and a different one for dark theme just like we can do for big and small icon ? Otherwise, does this mean the only way to adapt my icons is to check ThisApplication.ThemeManager.ActiveTheme.Name every time the events ApplicationEvents.OnApplicationOptionChange is fired ?
Solved! Go to Solution.
Solved by yan.gauthier. Go to Solution.
As far as I know, there is no special property for dar/light themes. But I guess that your alternative is a good solution and not that difficult to implement.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
To those interested. Here is the code I used to make it work (I work with C#, since VB.NET is a dying species)
private string activeTheme;
private void ApplicationEvents_OnApplicationOptionChange(EventTimingEnum BeforeOrAfter, NameValueMap Context, out HandlingCodeEnum HandlingCode)
{
if(BeforeOrAfter == EventTimingEnum.kBefore)
{
activeTheme = InvApp.ThemeManager.ActiveTheme.Name;
}
else if(BeforeOrAfter == EventTimingEnum.kAfter)
{
if (activeTheme.Equals("DarkTheme", StringComparison.OrdinalIgnoreCase) && InvApp.ThemeManager.ActiveTheme.Name.Equals("LightTheme", StringComparison.OrdinalIgnoreCase))
{
SetDarkThemeIcons();
}
else if (activeTheme.Equals("LightTheme", StringComparison.OrdinalIgnoreCase) && InvApp.ThemeManager.ActiveTheme.Name.Equals("DarkTheme", StringComparison.OrdinalIgnoreCase))
{
SetLightThemeIcons();
}
}
HandlingCode = HandlingCodeEnum.kEventNotHandled; //let Inventor do its thing
}
Can't find what you're looking for? Ask the community or share your knowledge.