Navisworks 2025 Scaling Oddly

ChristianMolino
Enthusiast

Navisworks 2025 Scaling Oddly

ChristianMolino
Enthusiast
Enthusiast

I have an add-in that I developed that does a simple search function. I just added support for Navisworks 2025 and noticed that all the buttons look weird and scaled compared to Navis '24. Upon further looking, it seems like EVERYTHING in navis '25 is scaled up by this amount.

 

Is this how Navis '25 is supposed to be or is there something wrong with the installer we used? Everyone at my company has it looking the same. If this is by design, how can I modify my code so that it looks the same as in Navis '24?

 

Let me know if you need to see additional code, I am very new to coding so this may be a very simple answer

 

ChristianMolino_0-1720040028945.png

 

namespace FindMarkNumbers
{
    [Plugin("FindMarkNumber", "Finfrock", ToolTip = "Find Mark Number Add-In", DisplayName = "Find Mark Number")]
    [DockPanePlugin(400, 400, AutoScroll = true, MinimumHeight = 100, MinimumWidth = 200)]
    public class FindMarkNumberPlugin : DockPanePlugin
    {
        private List<ModelItem> _currentSearchResults;
        private int _currentSearchIndex;
        private string _lastSearchedMarkNumber;
        private FindMarkNumberControl control;

        public override System.Windows.Forms.Control CreateControlPane()
        {
            control = new FindMarkNumberControl();
            //control.Dock = DockStyle.Fill;

            control.MarkNumberSelected += (sender, markNumber) =>
            {
                SelectAndHighlightModelItem(markNumber);
            };

            control.MarkNumberFirstSelected += (sender, markNumber) =>
            {
                SelectFirstAndHighlightModelItem(markNumber);
            };

            control.MarkNumberNextSelected += (sender, markNumber) =>
            {
                SelectNextAndHighlightModelItem(markNumber);
            };

            Autodesk.Navisworks.Api.Application.ActiveDocument.FileNameChanged += Application_FileNameChanged;
            UpdateMarkNumbers();

            //var markNumbers = GetFormattedMarkNumbers();
            //control.SetMarkNumbers(markNumbers);

            return control;
        }

 

Reply
561 Views
4 Replies
Replies (4)

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @ChristianMolino ,

 

Yes, you are correct that Navisworks 2025 uses a different, larger font.

Therefore, your next question might be: Is there a way to change the font to match that of Navisworks 2024?

The official answer is no, as this is not supported behavior. It is recommended that you adjust your AddIn so it is not constrained to a fixed size.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes

ChristianMolino
Enthusiast
Enthusiast

Even with the font size being different, shouldn't the actual size of the box be consistent? My understanding is that the size of the box is based on pixels regardless of the font size. I am attempting to make a different setting for '25 vs '24, but it seems odd that something based on pixels is appearing different across versions.

 

public FindMarkNumberControl()
{
    InitializeComponent();
    ApplyDefaultFont();
    AdjustButtonSizesBasedOnVersion();
}

private string GetNavisworksVersion()
{
    Assembly assembly = Assembly.GetAssembly(typeof(Autodesk.Navisworks.Api.Application));
    if (assembly != null)
    {
        string fullVersion = assembly.GetName().Version.ToString();
        return fullVersion;
    }
    return "Unknown";
}

private void AdjustButtonSizesBasedOnVersion()
{
    string navisworksVersion = GetNavisworksVersion();

    if (navisworksVersion.StartsWith("21"))
    {
        // Adjust sizes for Navisworks 2024
        SetButtonSizes(new Size(76, 23));
    }
    else if (navisworksVersion.StartsWith("22"))
    {
        // Adjust sizes for Navisworks 2025
        SetButtonSizes(new Size(64, 19));
    }
    else
    {
        // Default sizes for other versions
        SetButtonSizes(new Size(76, 23));
    }
}

private void SetButtonSizes(Size size)
{
    buttonFind.Size = size;
    buttonFindFirst.Size = size;
    buttonFindNext.Size = size;
}

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi,

One piece of text written in two different fonts takes up a different amount of pixels. Therefore if any of the containers whether buttons or panels are fixed sizes then it might not layout properly


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes

alexisDVJML
Collaborator
Collaborator

Hi @naveen.kumar.t,

 

Is such change in behaviour documented in Navisworks 2025 SDK release notes?
(I can't evne find Release Notes in the SDK packages, am I becoming too old and missed them??).
If not, I would say it's clearly a miss by the development team. Having accurate releases notes would avoid (or at least greatly reduce) having us, developers, discovering this type of issues, and help us plan what we have to do when deciding to support a new release.

PS: sorry you are the one facing my/our rants, feel free to send the developers 😉

Main Scientist, Full Stack Developer & When Time Permits Director of IDIGO ► On your marks, Set, Go
0 Likes