What for the Icon size Pyrevit

Hi PyRevit users,

This topic is not related to any code. I would just like to ask about the effect of icon sizes in PyRevit. I have noticed that we cannot use icons larger than 96x96, but it seems that all icons are smaller than that size, and I don’t see any difference between them.

By the way, could you please let me know what the best icon size to use is?

Thanks!

Never wondered about the why, I use 96px icons only

but looking at the code, it is specced in more than one place pyRevit/pyrevitlib/pyrevit/coreutils/ribbon.py at a00956d740aa04cf08aa3bbad5e25280d2bc3b62 · pyrevitlabs/pyRevit · GitHub

1 Like

Hi @Jean-Marc

My senior told me that I should use 24x24 but I don’t found any difference when I use the larger ones or smaller. Anyway, thanks for your information

We sometime get errors with 96x96 size on some machines in our org.
We use 48x48 by default for thst reason.

I think the standard sizes native for Revit is 16x16 for small icons and 32x32 for large.

Resolution is 96dpi
https://thebuildingcoder.typepad.com/blog/2010/09/ribbon-icon-resolution.html

2 Likes

Hi John, thanks for your answer I think that’s what I need

1 Like

To add to this if it’s anything like C# then I can confirm 96dpi, 32px for LargeImage and 16px for Image property of buttons is definitely the one that works best in my experience.

In pyRevit I have also noticed errors for using 96 and 48dpi, I believe it relates to something at a system/computer level as we haven’t been able to underpin the cause. Could be memory/buffer related potentially when the image is being read/converted to ImageSource for RevitAPI. Haven’t seen it in C#, so I’d guess it relates to the Python approach to converting the images.

2 Likes