Hi, need help
Problem statement: when i run a plugin that i build, any plugin, I Recive Following message, X the command line action failed: The Plugin was not found (attached picture)
it's happend with any code, so i try the basic plugin as debugging proccess
Thanks in advance, Mati.
Plugin location:
C:\Program Files\Autodesk\Navisworks Manage 2024\Plugins\BasicPlugIn.ABasicPlugin\BasicPlugIn.ABasicPlugin.dll
Roamer
"C:\Program Files\Autodesk\Navisworks Manage 2024\Roamer.exe" -OpenFile "C:\File.nwd" -ExecuteAddInPlugin "BasicPlugIn.ABasicPlugin"
Sequence:
open navisworks-> Open file-> Execute plugin (
Code
#region HelloWorld
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;
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 = "Hello World Plugin")] //Display name for the Plugin in the Ribbon
public class ABasicPlugin : AddInPlugin //Derives from AddInPlugin
{
public override int Execute(params string[] parameters)
{
MessageBox.Show(Autodesk.Navisworks.Api.Application.Gui.MainWindow, "Hello World");
return 0;
}
}
}
#endregion
Version:
Navisworks 2014
Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.9.5
Reference:
Property Value
(Name) | Autodesk.Navisworks.Api |
Aliases | global |
Copy Local | True |
Culture | |
Description | Autodesk.Navisworks.Api |
Embed Interop Types | False |
File Type | Assembly |
Identity | Autodesk.Navisworks.Api |
Path | C:\Program Files\Autodesk\Navisworks Manage 2024\Autodesk.Navisworks.Api.dll |
Resolved | True |
Runtime Version | v4.0.30319 |
Specific Version | False |
Strong Name | True |
Version | 21.0.0.0 |
Visual studio:
Property Value
Assembly name | BasicPlugin.ABasicPlugin |
Default namespace | BasicPlugin.ABasicPlugin |
Target framework | .NET Framework 4.8 |
Output type | Class Library |
Auto-generate binding redirects | (Not set) |
Startup object | (Not set) |
Solved! Go to Solution.
Solved by naveen.kumar.t. Go to Solution.
Hi @matiH7HD9 ,
You need to first load the DLL into Navisworks if the plugin is not found in the Plugins folder in the installation directory. To load the DLL into Navisworks, you need to use "-AddPluginAssembly" and then use "-ExecuteAddInPlugin".
Sample code:
namespace Navisworks_2024
{
[PluginAttribute("Navisworks2024", "ADSK2", ToolTip = "NW-2024", DisplayName = "My Plugin")]
public class Class1 : AddInPlugin
{
public override int Execute(params string[] parameters)
{
Document doc = Autodesk.Navisworks.Api.Application.ActiveDocument;
MessageBox.Show("Message");
return 1;
}
}
}
CommandLine:
"C:\Program Files\Autodesk\Navisworks Manage 2024\roamer.exe" -AddPluginAssembly "C:\..Your dll path here..\Navisworks 2024.dll" -ExecuteAddInPlugin "Navisworks2024.ADSK2"
Can't find what you're looking for? Ask the community or share your knowledge.