Context Help CHM Not Working After 2018

Context Help CHM Not Working After 2018

IngersollConsulting
Explorer Explorer
1,138 Views
8 Replies
Message 1 of 9

Context Help CHM Not Working After 2018

IngersollConsulting
Explorer
Explorer

The code that I am using to set a CHM help file to the command's ribbon button stopped working after the 2018.2 version. It works correctly in 2018 but does not work in 2019 or 2020. This is the help that is shown when the user hovers the mouse over the app command button on the add-ins ribbon and presses F1.

 

In the plugin class that implements IExtensionApplication, in the OnStartup method, I create the ribbon panel for the commands.

 

private PushButton m_commandButton;

internal static string AssemblyLocation
        {
            get
            {
                return Assembly.GetExecutingAssembly().Location;
            }
        }

public Result OnStartup(UIControlledApplication application)
        {

            CreateRibbonPanel(application);

            return Result.Succeeded;
        }

private void CreateRibbonPanel(UIControlledApplication application)
        {
            RibbonPanel myRibbonPanel = application.CreateRibbonPanel(Strings.CommandRibbon);

            m_commandButton = CommandClass.AddToRibbonPanel(myRibbonPanel);
        }

public static string GetHelpFilePath()
        {
            string helpFilePath = Path.Combine(Path.GetDirectoryName(AssemblyLocation), "CommandHelp.chm");

            return helpFilePath;
        }

 

In the command class that implements IExternalCommand, I have the code to create the ribbon button.

 

        public static PushButton AddToRibbonPanel(RibbonPanel ribbonPanel)
        {
            PushButtonData pushButtonData = new PushButtonData("CommandName", "My Command", MyPlugin.AssemblyLocation, "NameSpace.CommandClass");
            pushButtonData.ToolTip = "Tool tip";
            pushButtonData.LargeImage = GlobalResources.GetBitmapImageResource("Button_32x32.png");
            pushButtonData.Image = GlobalResources.GetBitmapImageResource("Button_16x16.png");
            pushButtonData.AvailabilityClassName = "NameSpace.CommandAvailabilityClass";

            PushButton myPushButton = ribbonPanel.AddItem(pushButtonData) as PushButton;

            ContextualHelp contextualHelp = new ContextualHelp(ContextualHelpType.ChmFile, MyPlugin.GetHelpFilePath());
            myPushButton.SetContextualHelp(contextualHelp);

            return myPushButton;
        }

This code works in 2018.2 and earlier, but stopped working in 2019.2 and later. In both versions, the GetHelpFilePath method returns the correct path to the CHM file in 

"C:\\ProgramData\\Autodesk\\ApplicationPlugins\\Company Application.bundle\\Contents\\Version\\Application\\CommandHelp.chm"

In the earlier version, the help file is displayed correctly. In the later versions, the help dialog shows an error:Capture.PNG

 

 

 

 

0 Likes
Accepted solutions (1)
1,139 Views
8 Replies
Replies (8)
Message 2 of 9

jeremytammik
Autodesk
Autodesk
0 Likes
Message 3 of 9

IngersollConsulting
Explorer
Explorer

Not really. I read this but I don't think there is anything in there about my situation specifically unless you can point me to something specific. The article talks mostly about invoking help from a dialog that is called by the application. I am trying to invoke help when the user presses the F1 key while hovering over the command button on the ribbon and the tooltip window is shown.

0 Likes
Message 4 of 9

jeremytammik
Autodesk
Autodesk

OK, understood. 

 

Strange that no such issues have been raised before by anyone, afaik.

 

Can you package your sample code as a minimal reproducible case, then, please, that I can pass on to the development team for analysis?

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

I guess all it needs is an external application that defines the button and the help file you wish to call.

 

Thank you.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 9

jeremytammik
Autodesk
Autodesk

Dear Zoltán,

 

Thank you for your reproducible case.

 

I logged the issue REVIT-148631 [ContextualHelp CHM does not work post-2018] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software.

 

They analysed the issue and discovered a problem that requires a code fix, so they raised a new development issue for that with the number REVIT-148931 [ContextualHelp CHM does not work post-2018].

 

Please make a note of these numbers for future reference.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 6 of 9

jeremytammik
Autodesk
Autodesk
Accepted solution

I checked the current status of change request number REVIT-148931 [ContextualHelp CHM does not work post-2018] and see that it has now been closed, with a fix submitted and tested for the first update release following the upcoming major release, so it should be working normally again soon.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 7 of 9

Dale.Bartlett
Collaborator
Collaborator

I am submitting to the AppStore and F1 contextual help is a requirement. Mine is also showing the same error when run in 2020. Once the CHM is open, clicking another topic will clear it and it will proceed as normal. Given that this is not resolved for 2019 and 2020, will this be acceptable?




______________
Yes, I'm Satoshi.
0 Likes
Message 8 of 9

jeremytammik
Autodesk
Autodesk

Dear Dale,

 

Thank you for your query and please rest assured.

 

I am sure the AppStore guys will help you resolve any problems, and your submission will be acceptable if the fault lies with the software and not with your implementation.

 

The ticket REVIT-148931 [ContextualHelp CHM does not work post-2018] has been successfully closed and is marked as released in Revit 2020.1 and in the upcoming next major release.

 

Another related issue REVIT-158211 [ContextualHelp for local html files does not pass parameters for topics properly -- 16182390] has also meanwhile been resolved. However, it did not make it into the upcoming next major release, but the one after, not expected until next year. Luckily, it has also been nominated for possible inclusion in an update release after the FCS of the upcoming next major release.

 

I hope this helps.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 9 of 9

Dale.Bartlett
Collaborator
Collaborator

Thanks Jeremy. I hadn't tested 2020.1 so that probably resolves it.




______________
Yes, I'm Satoshi.
0 Likes