Invoking a plugin through automation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The plugin(shown below) is running when i click the button in Add-ins tab of Navisworks application. But when I try to execute the plugin through automation its not working.
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
//Add two new namespaces
using Autodesk.Navisworks.Api;
using Autodesk.Navisworks.Api.Plugins;
using Autodesk.Navisworks.Api.Interop;
using Autodesk.Navisworks.Api.Timeliner;
using Autodesk.Navisworks.Api.Interop.Timeliner;
namespace BasicPlugIn
{
[PluginAttribute("BasicPlugIn.ABasicPlugin", //Plugin name
"ADSK", //4 character Developer ID or GUID
ToolTip = "BasicPlugIn.ABasicPlugin tool tip", //The tooltip for the item in the ribbon
DisplayName = "Simulation Play Plugin")] //Display name for the Plugin in the Ribbon
public class ABasicPlugin : AddInPlugin //Derives from AddInPlugin
{
public override int Execute(params string[] parameters)
{
LcTlSimulationHelper.Instance.Play();
return 0;
}
}
}
#endregion
I am trying to execute the above plugin using
string aString = "Hello";
Autodesk.Navisworks.Api.Automation.NavisworksApplication navisworksApplication =
new Autodesk.Navisworks.Api.Automation.NavisworksApplication();
navisworksApplication.ExecuteAddInPlugin("BasicPlugIn.ABasicPlugin.ADSK",aString);
But this does not help execute the plugin and start the timeliner simulation.