Dynamically Loaded Plugin Custom Tab Not Loading

Dynamically Loaded Plugin Custom Tab Not Loading

logikgate
Enthusiast Enthusiast
1,200 Views
4 Replies
Message 1 of 5

Dynamically Loaded Plugin Custom Tab Not Loading

logikgate
Enthusiast
Enthusiast

I have one plugin that dynamically loads another via the below code.  Both of these plugins have their own custom ribbon tabs.  If I call the below code during the initialization of the first plugin both tabs show up fine.  If I call the below code from a button in the first plugin's ribbon tab the second plugin's tab never shows up even though the second plugin is indeed loaded which I have verified via debugging and the AppInfo window of Navisworks.

 

Is there something that I have to do in order for Navisworks to "realize" that the dynamically loaded plugin has it's own custom tab?

 

            PluginRecord record = Application.Plugins.FindPlugin(pluginNameString);
            if (record != null)
            {
                if (!record.IsLoaded)
                {
                    record.LoadPlugin();
                }
            }
0 Likes
1,201 Views
4 Replies
Replies (4)
Message 2 of 5

Rene_Gerlach
Advocate
Advocate

Hi logikgate,

 

i had also some issues with my RibbonLayout.xml.

So may be some icons/text are not found on demand loading (diffent paths?)

 

Bad thing is, that the log nothing say about whats missing -> Could be enhanced at Autodesk side.

 

Good luck

 

Cheers

René

 

 

0 Likes
Message 3 of 5

logikgate
Enthusiast
Enthusiast

Thanks @Rene_Gerlach  I tried removing all icon images and have verified (via logs) that when the plugin is loaded dynamically Navisworks is indeed finding the *.name and *.xaml files.   

 

At this point I'm wondering if Navisworks just doesn't update the Ribbon when a plugin is loaded dynamically.  Has anyone successfully dynamically loaded a plugin that has a custom ribbon tab?

 

 

Plugin FlyPaper.Sherlock.AddIns.FlyP StringsAttribute(Sherlock.name) : Attempting to load strings...
LcUResource::FindLocalisedFile found C:\Users\abc\AppData\Roaming\Autodesk Navisworks Manage 2015\Plugins\FlyPaper.Sherlock\en-US\Sherlock.name
StringsAttribute : Loading SUCCEEDED from C:\Users\abc\AppData\Roaming\Autodesk Navisworks Manage 2015\Plugins\FlyPaper.Sherlock\en-US\Sherlock.name
LcUResource::FindLocalisedFile found C:\Users\abc\AppData\Roaming\Autodesk Navisworks Manage 2015\Plugins\FlyPaper.Sherlock\en-US\Sherlock.xaml

 

 

0 Likes
Message 4 of 5

Rene_Gerlach
Advocate
Advocate

Hello logikgate,

 

maybe this help: Use Same Tab with Different Plugins

https://forums.autodesk.com/t5/navisworks-api/use-same-tab-with-different-plugins/td-p/5760643

And on loading activate the Ribbon like in sample CustomRibbonHandler.cs - CanExecuteRibbonTab

 

one workaround could add all needed ribbon/ribbonpanel etc dynamically without the xml.

You can use again the AdWindow.dll (like mentioned in Localize RibbonPanel Title in Name File ) and Autodesk.Navisworks.Gui.Roamer.AIRLook functions to do so.

 

Cheers

René

0 Likes
Message 5 of 5

Anonymous
Not applicable

i believe this might be a better way. I have had no issues using this approach. with some tweaking yous should get this to work the way that you need it too

 

 

http://adndevblog.typepad.com/aec/2016/01/add-custom-panel-and-button-to-built-in-tab-of-navisworks-...

0 Likes