Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Navisworks - Convert NWC/NWD to DXF via FBX using C#

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
IPrtk
246 Views, 2 Replies

Navisworks - Convert NWC/NWD to DXF via FBX using C#

Problem statement

I am trying to export the NWD file to DXF via C#.

 

What have I done till now?

I have created a plugin to call this below method POCMethod(string pa) which exports the active document to FBX. After the file is converted to FBX, I am planning to convert the files to DXF using some DLLs of 3D Max.

public class ExportNWDAsDXFPlugIn : AddInPlugin
{
	public override int Execute(params string[] parameters)
	{
		if (!string.IsNullOrWhiteSpace(nwdFilePath))
		{
			if (result == true)
			{            
				POCMethod(nwdFilePath);
				return 1;
			}
		}
		return 0;
	}
	
	private void POCMethod(string pa)
	{
		try
		{
			PluginRecord FBXPluginrecord = Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("NativeExportPluginAdaptor_LcFbxExporterPlugin_Export.Navisworks");

			if (FBXPluginrecord != null)
			{
				if (!FBXPluginrecord.IsLoaded)
				{
					FBXPluginrecord.LoadPlugin();
				}
			}

			Plugin FBXplugin = FBXPluginrecord.LoadedPlugin as Plugin;
			FBXplugin.GetType().InvokeMember("Execute",
				System.Reflection.BindingFlags.InvokeMethod,
				null,
				FBXplugin,
				new string[] { pa });
		}
		catch (Exception ex)
		{
			throw;
		}
	}
}

 

Problem

  1. I am selecting a file as an active document in the Navisworks editor window and executing this plugin. The popup window showing the conversion percentage is displayed, but the exported file is not saved in the file path.
  2. This plugin requires to manually load the document in the editor context. But I need to run the conversion for multiple Navisworks files in a folder location. Any suggestions on how that can be achieved via C#?
2 REPLIES 2
Message 2 of 3
tetsuya_miwa
in reply to: IPrtk

If you want convert multiple files, call Roamer.exe with proper arguments for each file.
https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/How-to-automate-th...

Message 3 of 3
IPrtk
in reply to: tetsuya_miwa

Can you point me to any similar implementation to convert FBX to DXF using 3DS Max?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report