Navisworks API

Reply
Contributor
karteek.iitm
Posts: 12
Registered: ‎02-24-2012
Message 1 of 4 (182 Views)

Invoking a plugin through automation

182 Views, 3 Replies
01-04-2013 07:26 AM

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.

ADN Support Specialist
xiaodong.liang
Posts: 1,263
Registered: ‎06-12-2011
Message 2 of 4 (170 Views)

Re: Invoking a plugin through automation

01-07-2013 09:19 PM in reply to: karteek.iitm

Hi, 

 

Did you mean if LcTlSimulationHelper.Instance.Play(); cannot work when calling from an automation, or any code (like pop out a message box in the plugin)? If it is for LcTlSimulationHelper, sorry as I having said, this is NOT a public API we support now. We cannot guarantee all of its behaviors.



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Contributor
karteek.iitm
Posts: 12
Registered: ‎02-24-2012
Message 3 of 4 (166 Views)

Re: Invoking a plugin through automation

01-08-2013 12:10 AM in reply to: xiaodong.liang

Yes. LcTlSimulationHelper.Instance.Play() is not working when that plugin is called through automation. But it is working perfectly as a plugin in navisworks application.

ADN Support Specialist
xiaodong.liang
Posts: 1,263
Registered: ‎06-12-2011
Message 4 of 4 (154 Views)

Re: Invoking a plugin through automation

01-10-2013 11:53 PM in reply to: karteek.iitm

Since this is not a public (unsupported) API, things could go wrong.. Sorry for not much helping at this moment.



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community