- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I compiled the following code and then placed the compiled files into a document within the plugin document.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Navisworks.Api;
using Autodesk.Navisworks.Api.Plugins;
namespace ChangeCouleurPlugin
{
[PluginAttribute("ChangeCouleurPlugin", "ADSK", ToolTip = "ChangeCouleurPlugin", DisplayName = "ChangeCouleurPlugin")]
public class ChangeCouleurPlugin : AddInPlugin
{
public override int Execute(params string[] parameters)
{
Search search = new Search();
search.Selection.SelectAll();
search.SearchConditions.Add(SearchCondition.HasPropertyByDisplayName("Entity Handle", "Value").EqualValue(VariantData.FromDisplayString("C0A4")));
ModelItemCollection searchResults = search.FindAll(Autodesk.Navisworks.Api.Application.ActiveDocument, false);
Application.ActiveDocument.CurrentSelection.CopyFrom(searchResults);
return 0;
}
}
}
After completing these steps, I attempted to open Navisworks but encountered a pop-up message that refuses to disappear.
Is the problem with my code or is there another issue?
Thank you for the response !
Edward Dufour
Solved! Go to Solution.