using System;
using Autodesk.Navisworks.Api;
using Autodesk.Navisworks.Api.DocumentParts;
using NavisworksSearchSetImporter;
namespace NavisworksSearchSetImporter
{
public class SearchSetImporter
{
public void ImportSearchSet(string filePath)
{
// Open the Navisworks document
Document oDoc = Autodesk.Navisworks.Api.Application.ActiveDocument;
// Load the search set from the file
DocumentSelectionSets oSets = oDoc.SelectionSets;
oSets.Import(filePath);
Console.WriteLine("Search set imported successfully.");
}
}
}
class Program
{
static void Main(string[] args)
{
SearchSetImporter importer = new SearchSetImporter();
string filePath = @"C:\Users\olagb\Desktop\Coding\YourSearchSetFile.xml";
importer.ImportSearchSet(filePath);
}
}
Метод Import на объекте osets , похоже, не реконгнирован и помечен как ошибка, несмотря на импорт правильных ссылок.
Я пытался выполнить этот код, но метод Import объекта oSets помечен как ошибка. [code]using System; using Autodesk.Navisworks.Api; using Autodesk.Navisworks.Api.DocumentParts; using NavisworksSearchSetImporter;
namespace NavisworksSearchSetImporter { public class SearchSetImporter { public void ImportSearchSet(string filePath) { // Open the Navisworks document Document oDoc = Autodesk.Navisworks.Api.Application.ActiveDocument;
// Load the search set from the file DocumentSelectionSets oSets = oDoc.SelectionSets; oSets.Import(filePath);
Console.WriteLine("Search set imported successfully."); } } }
class Program { static void Main(string[] args) { SearchSetImporter importer = new SearchSetImporter(); string filePath = @"C:\Users\olagb\Desktop\Coding\YourSearchSetFile.xml"; importer.ImportSearchSet(filePath); } }
[/code] Метод Import на объекте osets , похоже, не реконгнирован и помечен как ошибка, несмотря на импорт правильных ссылок.