提问人:PAPIWARBUX 提问时间:6/19/2023 最后编辑:Brian Tompsett - 汤莱恩PAPIWARBUX 更新时间:7/4/2023 访问量:99
我的课程库有什么问题?“致命的执行引擎错误”
What's wrong with my Class Library? 'Fatal Execution Engine Error'
问:
我正在尝试使Navisworks插件管理,它将使用前缀或后缀重命名一批选定的冲突。我在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!");
}
}
}
当我运行程序时,出现以下错误。
答: 暂无答案
评论
Autodesk.Navisworks.Api.Application
Autodesk.Navisworks.Api.Application