-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from koechlm/2025.1.0.0
2025.1.0.0
- Loading branch information
Showing
12 changed files
with
359 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
Autodesk.VltInvSrv.ExportSampleJob/NavisworksExportPluginSamples.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using Autodesk.Navisworks.Api.Automation; | ||
|
||
namespace NavisworksExportExample | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
// Initialize the Navisworks Automation object | ||
NavisworksApplication mNavisworksAutomation = new NavisworksApplication(); | ||
|
||
// Path to the document to open | ||
string mDocPath = @"C:\path\to\your\file.nwd"; | ||
// Path to save the new Navisworks file | ||
string mNWDName = @"C:\path\to\output\file.nwd"; | ||
// Path to save the export file | ||
string mExportFilePath = @"C:\path\to\output\file"; | ||
|
||
// Condition to check for exporting format | ||
string exportFormat = "DWF"; // Change this to the desired format | ||
|
||
try | ||
{ | ||
// Open the file with Navisworks; opening other file formats creates a new Navisworks file appending the import file | ||
mNavisworksAutomation.OpenFile(mDocPath); | ||
|
||
// Save the new Navisworks file | ||
mNavisworksAutomation.SaveFile(mNWDName); | ||
|
||
// Export to the desired format using the appropriate plugin | ||
switch (exportFormat) | ||
{ | ||
case "DWF": | ||
mNavisworksAutomation.ExecuteAddInPlugin("NativeExportPluginAdaptor_LcDwfExporterPlugin_Export.Navisworks", mExportFilePath + ".dwf"); | ||
Console.WriteLine("Export to DWF successful!"); | ||
break; | ||
case "FBX": | ||
mNavisworksAutomation.ExecuteAddInPlugin("NativeExportPluginAdaptor_LcFbxExporterPlugin_Export.Navisworks", mExportFilePath + ".fbx"); | ||
Console.WriteLine("Export to FBX successful!"); | ||
break; | ||
case "RVT": | ||
mNavisworksAutomation.ExecuteAddInPlugin("NativeExportPluginAdaptor_LcRvtExporterPlugin_Export.Navisworks", mExportFilePath + ".rvt"); | ||
Console.WriteLine("Export to RVT successful!"); | ||
break; | ||
// Add more cases for other formats as needed | ||
default: | ||
Console.WriteLine("Unsupported export format."); | ||
break; | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
Console.WriteLine($"An error occurred: {ex.Message}"); | ||
} | ||
finally | ||
{ | ||
// Clean up the Navisworks Automation object | ||
mNavisworksAutomation.Dispose(); | ||
} | ||
} | ||
} | ||
} |
Binary file modified
BIN
+5 KB
(100%)
Autodesk.VltInvSrv.ExportSampleJob/SDK Refs/Autodesk.Navisworks.Api.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
Autodesk.VltInvSrv.ExportSampleJob/SDK Refs/Autodesk.Navisworks.Automation.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Autodesk.VltInvSrv.ExportSampleJob/SDK Refs/Autodesk.Navisworks.Controls.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Autodesk.VltInvSrv.ExportSampleJob/SDK Refs/Autodesk.Navisworks.Resolver.dll
Binary file not shown.
Binary file added
BIN
+2.64 MB
Autodesk.VltInvSrv.ExportSampleJob/SDK Refs/SolidWorks.Interop.sldworks.dll
Binary file not shown.
Binary file added
BIN
+455 KB
Autodesk.VltInvSrv.ExportSampleJob/SDK Refs/SolidWorks.Interop.swconst.dll
Binary file not shown.