I am trying to make an Plug In for Navisworks manage that will rename a batch of selected clashes with a prefix or suffix. I am running this on Visual Studio.
using Autodesk.Navisworks.Api;
using Autodesk.Navisworks.Api.Clash;
namespace ClashTestNameModifier
{
class Program
{
static void Main(string[] args)
{
// Open the Navisworks document
string modelPath = @"C:\path\to\your\model.nwd";
Autodesk.Navisworks.Api.Application app = new Autodesk.Navisworks.Api.Application();
Autodesk.Navisworks.Api.Document doc = app.OpenFile(modelPath);
// Get the selected clash tests
Autodesk.Navisworks.Api.Clash.TestsData clashTestsData = doc.GetClash().TestsData;
SavedItemCollection selectedTests = clashTestsData.Tests.Value.GetSelectedItems();
if (selectedTests.Count == 0)
{
System.Console.WriteLine("No clash tests selected.");
return;
}
// Modify the clash test names
string prefix = "New Prefix ";
string suffix = " - Suffix";
foreach (SavedItem testItem in selectedTests)
{
ClashTest test = clashTestsData.TestsDataArray[testItem.Index];
test.DisplayName = prefix + test.DisplayName + suffix;
}
// Save the modified document
doc.SaveFile(modelPath);
// Close the document
doc.Close();
// Dispose of the application
app.Dispose();
System.Console.WriteLine("Clash test names modified successfully!");
}
}
}
When I run the program I get the following errors.

To create a plugin for Navisworks, you need to start by creating a class library project in the .dll format. The simplest type of plugin is
AddinPlugin, which can be found in theAutodesk.Navisworks.Api.Pluginsnamespace. For more information on creating Navisworks plugins, you can refer to the link provided below.https://apidocs.co/apps/navisworks/2018/87317537-2911-4c08-b492-6496c82b3ed6.htm
I have tried to edit your code so that it works, but one issue is that the Navisworks Clash API does not currently support the retrieval of selected tests from the UI. The documentation states that the UI part of the Clash API is still underdeveloped.
In order to run this on a console application, you may need to reference and use the
Autodesk.Navisworks.Automationassembly. With Automation, it's also possible to invoke a plug-in and receive a reply in the form of a status code. For additional information, please visit the following link:https://apidocs.co/apps/navisworks/2018/87317537-2911-4c08-b492-6496c82b3ed7.htm